Composite keybindings + scripting from shell #2872
Replies: 10 comments 2 replies
-
I rely heavily on keybindings that launch commands in a new tab/window based off the current window's cwd. This is really core to my daily workflow. Here's a common example that I use in kitty:
The lack of launch keybindings is the only reason I can't really use ghostty as my main daily driver terminal. |
Beta Was this translation helpful? Give feedback.
-
And one more vote for keybind-scripting-feature. Another option that could fit me would be a "custom profile" feature. It would works like keybinding that opens a new tab + startup command or startup script. |
Beta Was this translation helpful? Give feedback.
-
Related to #3199 They could even be implemented with the same action.
|
Beta Was this translation helpful? Give feedback.
-
Relatedly, the suggestion of |
Beta Was this translation helpful? Give feedback.
-
I would also be interested in a method to programmatically invoke ghostty keybind actions - specifically write_scrollback_file. I wrote a tool to supply command line prompt suggestions (https://github.com/jechter/boltprompt), which has an option for LLM-based suggestions using the current terminal scrollback for context. I can get scrollback contents in Terminal.app and iTerm using AppleScript, but have not found a way to programmatically access it in ghostty yet. |
Beta Was this translation helpful? Give feedback.
-
Ghostty plans on having the ability to be programmatically controlled in the future the discussion that has the most information about this (since implementing it requires this ability) is #2353 You may also be interested in #3782 but that just leads back to the other issue I linked above TL;DR this is mostly a dupe of what #2353 wants to implement (it goes beyond just windows, tabs and splits). I didnt read exactly what the proposals here are but its very nice to consolidate into one discussion please use #2353 going forward |
Beta Was this translation helpful? Give feedback.
-
I've turned off window decorations because GTK and Adwaita are subjectively not a fit for my setup: I'm inconsistently fussy :) Anyhow, this means I lose the built-in tabs feature, so I've had to run And then to make the Ctrl+Tab and Ctrl+Shift+Tab keys switch But there's not currently a way to map Ghostty bindings to run custom commands, so I've lost the ability to switch tabs when I'm running |
Beta Was this translation helpful? Give feedback.
-
Maybe related to #4406 ? |
Beta Was this translation helpful? Give feedback.
-
Just want to add my vote here. In Wezterm I have a keybinding to toggle Caffeine by calling an osascript. Having this feature has a lot of benefits, especially if we can continue to use the If these scripts need to run in a terminal, then maybe they could be run in the quickterm (thus if they error they error there) or maybe in a pop-up (with similar error message handling). Related, it may be good to have OS dependent options (how I did this in Wez. Refer to the |
Beta Was this translation helpful? Give feedback.
-
BEFORE POSTING HERE PLEASE READ THISLike stated in my previous comment the feature request here will be duplicate work of the one in #2353 Just be cause the title says windows, tabs and splits it goes beyond that as the system that allows that would allow allow scripting from shell like setting keybinds please stop posting on this issue and use #2353 so everything can be consolidated in one issue |
Beta Was this translation helpful? Give feedback.
-
It would be awesome if ghostty supported more complex keybind actions, maybe such as alacritty's
command = { program ... }
.Here is an example of alacritty's shortcut to switch to previous job (I haven't found a way to do it with alacritty's built in keymaps sequences since it requires a delay):
With the additional ability to call actions from ghostty cli (for example
ghostty -a write_scrollback_file:paste
, similar to how it is done in tmux) it could enable some potentially interesting scenarios, such as parsing scrollback and opening each file in vim in new tab (or just the file under the cursor).Potential examples:
Beta Was this translation helpful? Give feedback.
All reactions