
是否可以在 Gnu 畫面中載入多個設定檔?
我嘗試了多種-c
選擇,但都失敗了。
基本思想是保持預設~/.screenrc
加載,並在其上方添加自訂會話配置。
答案1
我所做的是,我有一個通用的 screenrc 文件,並從自訂會話文件中包含它。例如我有~/.config/screen/gnus.screenrc
包含
sessionname gnus
source common.screenrc
chdir /
screen -t gnus emacs -nw -f gnus
我運行scr gnus
開啟此會話,其中scr
有一個腳本,用於安排附加到正在運行的會話或開啟具有指定名稱的新會話,並使用會話名稱建立設定檔的路徑。
#!/bin/sh
session_name=$1
rc_file=~/.config/screen/$session_name.screenrc
exec screen -c "$rc_file" -S "$session_name" -r -R -d "$@"