Byobu does not read aliases defined in /etc/profile.d or in .profile
Bug #1618516 reported by
Jonas Björkman
This bug affects 4 people
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
byobu |
Confirmed
|
Medium
|
Unassigned | ||
byobu (Ubuntu) |
Triaged
|
Low
|
Unassigned |
Bug Description
This is tested in RHEL 7.2 so feel free to remove this post if this is not relevant here.
Using a byobu install via linuxbrew (byobu 5.106 and tmux 2.1)
When I start byobu all aliases that are defined in /etc/profile.d/* or in my own .profile are not carried over to byobu. If I run tmux as is, this is not the case, and that makes me suspect that this is not the intended feature of byobu.
Changed in byobu: | |
importance: | Undecided → Medium |
status: | New → Confirmed |
To post a comment you must log in.
OK, after submitting this, I found out that its a duplicate of 525552
So modifying these two files to use the --login option fixes my problem.
bin/byobu-shell
[ -n "$SHELL" -a -x "$SHELL" ] && exec "$SHELL" --login || exec /bin/sh --login
share/byobu/ profiles/ tmux
set -g default-command $SHELL --login
The first one fixes the initial window and the second one fixes any subsequent windows/splits
However, tmux specifically states in the changed file that it wishes, _not_ to read .profile again:
```
# Must set default-command to $SHELL, in order to not source ~/.profile
# BUG: Should *not* hardcode /bin/bash here
set -g default-command $SHELL
```
And indeed, when running tmux on its own (without the --login modification) and adding new windows/splits the aliases from /etc/profile.d/ end .profile are inherited from the original session.
So, somewhere there seems to be a discrepancy how byobu initializes tmux windows.
This is also not a stable solution since as soon as byobu is updated these files will be overwritten.