我正在使用终止符布局来启动多个终端,并希望在每个终端启动处调用在 my 中定义的别名.bash_aliases
(由.bashrc
和调用.profile
)。不幸的是,终结者在启动终端时并不知道这些别名。我该如何解决这个问题?
我用这个命令启动终结者:
terminator -l my_layout -f
编辑:
作为临时解决方案,我ssh -A -YC
进入自己,然后运行别名。所有这些都是自定义命令。
答案1
为您的终结者窗口设置一个环境变量,并从您的.bashrc
.在终结者的配置中:
[layouts]
[[default]]
[[[child0]]]
order = 0
parent = ""
type = Window
[[[child1]]]
labels = Alias0, Alias1, None
order = 0
parent = child0
type = Notebook
[[[terminal1]]]
order = 0
parent = alias0
profile = root
type = Terminal
[[[terminal2]]]
order = 1
parent = child1
profile = alias1
type = Terminal
[[[terminal3]]]
order = 2
parent = child1
profile = default
type = Terminal
[profiles]
[[alias0]]
custom_command = MY_ALIAS=0 bash
use_custom_command = True
[[alias1]]
custom_command = MY_ALIAS=1 bash
use_custom_command = True
并在.bashrc
:
case $MYALIAS in
0) alias0
;;
1) alias1
;;
*)
;;
esac