我想为一个选项卡设置一个名称,但是在iterm2中只有一个会话标题。
当我在一个标签上有一个分割窗格时,

但是,在将选项卡拆分为两个窗格后,会话标题将发生更改。

是否有一种方法可以在拆分后编写一个脚本来保存会话标题?
发布于 2017-05-10 08:43:42
我通过遵循applescript来解决这个问题:
tell application "iTerm"
tell current session of current window
set nameOfSession to {get name} as text
set newSession to {split horizontally with same profile}
select newSession
set name to nameOfSession
end tell
end tell将其放入~/Library/Application Support/iTerm/Scripts,重新启动iterm2,然后您可以在Script Menu (更多关于脚本的信息)中看到脚本。
而且您可能希望映射一个快捷方式,以便在系统键盘快捷方式设置中执行脚本。
https://stackoverflow.com/questions/43882820
复制相似问题