In iTerm2 (I am using Build 2.1.4 as of this writing), how can I clear scrollback buffers for all sessions. I know that cmd+K will clear current session. Using the same key combination does not work along with broadcast input.
Appreciate the help!
iterm2keyboard shortcuts
In iTerm2 (I am using Build 2.1.4 as of this writing), how can I clear scrollback buffers for all sessions. I know that cmd+K will clear current session. Using the same key combination does not work along with broadcast input.
Appreciate the help!
Best Answer
This applescript should clear scrollback for all sessions in the current iTerm window:
To bind that to a keyboard shortcut:
Open Automator and create a new Service.
Set "Service Receives" to "no input" and select "iTerm.app" as the application.
Put in a single Run Applescript action, and paste in the code from above.
Save it as
clear-all-scrollback-buffers-in-current-iterm-window
.Now when iTerm is open, you'll see that service in the menubar under iTerm > Services.
Open System Preferences > Keyboard > Shortcuts > Services. Scroll down until you see
clear-all-scrollback-buffers-in-current-iterm-window
. Give it a keyboard shortcut (eg, optioncommandk)If that doesn't work, you might try the following AppleScript instead: