Comment 33 for bug 525552

Revision history for this message
Reinis Danne (readan2) wrote :

I'm using byobu-tmux with bash and .bash_profile is not sourced at all so I'm missing my alias, functions, environment variables and even bash-completion doesn't work. To enable profile sourcing, login mode for the shell has to be used.

As far as I can gather, login mode is disabled on purpose. I don't know the reason for it though (maybe so that random stuff from profiles wouldn't get sourced), but it should provide at least a setting to chose whether to use login shell.

There are two places where new shell is started when launching byobu:
1) /usr/bin/byobu-shell does exec "$SHELL"
2) /usr/share/byobu/profiles/tmux does set -g default-command $SHELL

Tmux by default starts login shell, but it is explicitly disabled in /usr/share/byobu/profiles/tmux for byobu by setting default-command. A workaround is to comment out that line. I didn't manage to figure out how to unset default-command from user profile.

Seems like most shells support -l | --login flag, so that also can be used to start login shell:
1) /usr/bin/byobu-shell: exec "$SHELL" --login
2) /usr/share/byobu/profiles/tmux: set -g default-command $SHELL --login

The first point is need so that initial byobu window uses login shell and the second for the subsequent windows.

Previous commenter mentioned using -$SHELL to get login shell, but that link is not installed on all distros, so I think the flag is the best option.