在 iterm2 中拆分窗格后保持 session 标题
Holding session title after spliting pane in iterm2
我想给标签取个名字,但是在iterm2中只有session个标题。
当我在一个选项卡中有一个拆分窗格时,它工作正常,
但是 session 标题会在将选项卡拆分为两个窗格后发生变化。
有没有办法写一个脚本在拆分后保持session标题?
我通过以下 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
看到脚本了(more about scripts).
并且您可能想要在系统键盘快捷方式设置中映射一个快捷方式来执行脚本。
我想给标签取个名字,但是在iterm2中只有session个标题。
当我在一个选项卡中有一个拆分窗格时,它工作正常,
但是 session 标题会在将选项卡拆分为两个窗格后发生变化。
有没有办法写一个脚本在拆分后保持session标题?
我通过以下 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
看到脚本了(more about scripts).
并且您可能想要在系统键盘快捷方式设置中映射一个快捷方式来执行脚本。