重命名会话

D W*_*D W 3 session bash gnu-screen

在 bash 中,我可以通过执行以下操作来启动命名屏幕

screen -S test
Run Code Online (Sandbox Code Playgroud)

如果我输入

ctrl-a A new_screen_name
Run Code Online (Sandbox Code Playgroud)

它只会改变屏幕的标题。当我做一个

screen -r
Run Code Online (Sandbox Code Playgroud)

我看到会话名称仍然相同。

Den*_*son 5

来自info screen

-- 命令:sessionname [NAME]
(none)
重命名当前会话。请注意,对于screen -list' the name shows up with the process-id prepended. If the argument NAME is omitted, the name of this session is displayed. _Caution_: Among other problems, the$STY' 环境变量仍反映旧名称。强烈建议不要使用此命令。如果您需要此功能,请使用“-S”命令行选项。默认值由 tty 和主机名构成。