Due to a bug in "lxterminal -l" the only way to make lxterminal start a /bin/bash login shell is to run "lxterminal -e 'bash -il'".
This works for the first tab opened, but the '-e' command is not run for new tabs, so the shell in those tabs will not be login shells (and thus will not have path changes from ~/.bash_profile etc).
There doesn't seem to be a way to make lxterminal always start login bash shells in every tab.
Can we make '-e' apply for every tab opened in that lxterminal window? If that is too surprising, can we add a config option to .config/lxterminal/lxterminal.conf to set a default command to run when the '-e' option is not used (ie when not provided or when opening new tabs)?
I don't fully understand why shells started by xterms are not login shells by default. The recommended practice with shells are to put things like PATH=foo:$PATH additions in ~/.profile or ~/.bash_profile which are only invoked in login shells to avoid them being re-executed in every sub-shell. In an X environment there is no parent login shell that will have done this for you, so the recommended practice for xterm's is to make them spawn login shells. Is there a better practice than this?
For the record, I'm currently using the following nasty hacks to workaround this problem.
In .profile (only read by /bin/sh login shells since I have .bash_profile);
At the end of .bash_profile (only ready by /bin/bash for login shells);
At the top of .bashrc (read by /bin/bash for all shells);
How about an option (-L would make sense) that would make the window spawn login shell (same as -l) but would also make all subsequent tabs (for that window) a login shell as well?
Last edit: FinboySlick 2015-03-30
Is there any reason why -l should not apply to tabs as well? What about some way to specify a command for all tabs too? Dunno.
In things like gnome-terminal these kinds of differences are handled by having profiles, and you can pick a profile when you start a new tab or terminal. I dunno if lxterminal needs that, but if it was cheap&easy (ie, not too much bloat) then it might be nice.
If we assume lxterminal doesn't support "profiles", then I think it would make sense to behave like all tabs have the "same profile", which means things like -e and -l should apply to all tabs in the same lxterminal.
Fixed in git. -l/--loginshell now applies to all tabs created by the the terminal window.