summaryrefslogtreecommitdiff
path: root/rc/windowing
AgeCommit message (Collapse)Author
2025-07-11Fix uses of non-standard == in shell testsHEADmasterMaxime Coste
Fixes #5357
2025-06-20rc windowing hyprland: initErik Alonso
2024-04-12Introduce "local" scope in evaluate-commandsMaxime Coste
When using `eval` a new scope named 'local' gets pushed for the whole evaluation, this makes it possible to temporarily set an option/hook/alias... Local scopes nest so nested evals do work as expected. Remove the now trivial with-option command
2024-03-09Merge remote-tracking branch '2xsaiko/outgoing/appleterminal'Maxime Coste
2024-03-08rc windowing tmux: remove redundant backgroundingJohannes Altmanninger
The tmux-terminal commands typically run tmux split-window kak -c ${kak_session} </dev/null >/dev/null 2>&1 & The tmux process runs in the background with output silenced. This is not necessary because "tmux split-window" is a thin client that merely forwards its arguments to the tmux server. All our wrappers for other terminal-servers (kitty, iterm, screen, wezterm, zellij) simply run in the foreground, not silencing any errors. The tmux backgrounding was added in 208b91627 (Move client.kak as x11.kak and change tmux.kak to be its peer, 2015-11-17), probably for consistency with x11.kak. That one is different however because it potentially spawns a full terminal, not just a client that briefly talks to a terminal server - that's why x11-terminal needs to use "setsid," to avoid killing said terminal when we signal our process group. Remove the backgrounding from tmux.kak for consistency and to reduce surprise.
2024-03-06Add Terminal.app supportMarco Rebhan
2024-02-15pass pane-id to wezterm cliYukai Huang
2023-12-16rc windowing: with-option to restore option value also after errorJohannes Altmanninger
Today "with-option foo bar command-that-fails" fails with Error: 1:1: 'evaluate-commands': 1:1: 'with-option': 2:5: 'evaluate-commands': 4:9: 'evaluate-commands': 1:2: 'no-such-command': no such command but leaks the option value. Fix this by resetting the option and rethrowing the error. Unfortunately the original stack trace is lost (questionable behavior inherited from C++?).
2023-11-13rc windowing: allow to configure windowing system and window placement in ↵Johannes Altmanninger
new/terminal commands Today I can control "terminal" and "new" by changing the terminal alias but I always need to choose a concrete implementation, like "tmux-terminal-horizontal", even when there is otherwise no need to mention tmux in my config. Allow to configure windowing system and window placement independently by introducing dedicated options. This allows to create mappings that work in any windowing system like map global user c %{:with-option windowing_placement window new<ret>} map global user '"' %{:with-option windowing_placement vertical new<ret>} map global user '%' %{:with-option windowing_placement horizontal new<ret>} For windowing systems that don't support all placements, you can wrap the above in try/catch to fall back on the "window" variant which is defined for all windowing systems. When using multiple (nested) windowing systems, you might want to add mappings like map global user t %{:with-option windowing_module tmux new<ret>} map global user T %{:with-option windowing_module wayland new<ret>} --- This changes the default "terminal" alias for some modules. In particular, instead of delegating to iterm-terminal-vertical screen-terminal-vertical tmux-terminal-horizontal wezterm-terminal-vertical it will now by default delegate to the respective "-window" variant. We could maintain backwards compatiblity here by setting the "windowing_placement" option accordingly, but the new behavior seems more logical? Also, this removes the "terminal-tab" alias which was only defined by the kitty module. We could try to keep the alias approach and implement a "with-alias" command, however that approach can only capture both dimensions (windowing system and placement) if we add tons of commands like "terminal-horizontal" (with implied windowing system) and "tmux-terminal" (with implied placement). Side thought: we could also get rid of the "focus" alias and instead define define-command focus %{ "%opt{windowing_module}-focus" } Closes #3943, #4425
2023-11-13rc windowing: fix docstringsJohannes Altmanninger
2023-11-13rc windowing sway: add sway-terminal-tabJohannes Altmanninger
Not sure about this one, the implementation seems hacky so I'm not sure if it always does what the user expects.
2023-11-13rc windowing sway: add sway-terminal-{vertical/horizontal}Johannes Altmanninger
2023-07-27pass cwd for wezterm terminalBob Qi
2023-06-13Fix windowing detection echoing last module error if none matchedMaxime Coste
Display a more general message in the debug buffer.
2023-06-09fix arg quotingBob Qi
2023-06-09rc/windowing/wezterm.kakBob Qi
2023-05-10Merge remote-tracking branch 'Frojdholm/rc-windowing-kitty-window-id'Maxime Coste
2023-05-09rc windowing wayland/x11: do not pollute terminal environmentJohannes Altmanninger
The x11-terminal command spawns a potentially long-lived terminal process. The terminal can is completely independent of the Kakoune session that created it. Due to how it's implemented, the spawned terminals will have environment variables "kak_opt_termcmd" and "kak_quoted_reg_a" set. This can be surprising, especially since, by convention, the environment contains no lowercase variables. Let's stop exporting them.
2023-05-07Match against kitty window id directly when using kitty @ launchHampus Fröjdholm
When launch matches using `id` kitty tries to match against tab id before matching windows. When there are multiple tabs it's likely to match a tab before matching a window. Use `window_id` directly to avoid any possiblity of matching tabs. This is only needed for `kitty @ launch` for other commands there is no specific `window_id` field.
2023-03-13Merge remote-tracking branch 'krobelus/tmux'Maxime Coste
2023-02-26add zellij-action commandBob Qi
2023-02-24remove the option and provide session name explictlyBob Qi
2023-02-22give up to wrap command into a shell to avoid conflict with connect.kakBob Qi
2023-02-22Create zellij.kakBob
2022-11-20Deduplicate iterm2 escaping codeMarco Rebhan
This fixes PATH and TMPDIR not being escaped in the iterm-terminal-window and iterm-terminal-tab commands.
2022-11-20Handle spawning iTerm and screen commands with arguments containing newlinesMarco Rebhan
Before, sed would add quotes to every line of the single multiline argument, causing the final quoted argument to "split ... command" or screen to contain unquoted newlines such as this (from kakoune-cr): tell application "iTerm" tell current session of current window tell (split vertically with same profile command "env PATH='...' 'sh' '-c' '' ' export KAKOUNE_SESSION=$1' ' export KAKOUNE_CLIENT=$2' ' shift 3' '' ' [ $# = 0 ] && set \"$SHELL\"' '' ' \"sh\"' ' ' '--' '51909' 'client0' 'terminal' ") to select end tell end tell Instead of using sed to do this which operates on single lines at a time, simply use printf to insert ' quotes before and after the entire argument.
2022-11-19rc repl tmux: always spawn repl in calling clientJohannes Altmanninger
Just like the parent commit but for tmux-repl-* commands. Note that tmux-repl-set-pane without arguments is kind of broken; it increments the current pane ID, which only works in the most basic scenarios. We should probably replace it with something better, with menu completions etc.
2022-11-19rc windowing tmux: always spawn tmux-terminal-window in calling clientJohannes Altmanninger
The tmux-terminal-window command always spawns windows in the tmux session where the Kakoune session was started - even if the calling Kakoune client lives in a different tmux session. Fix this by always creating the window in the tmux session of the calling client. We already do the same for tmux-terminal-{horizontal,vertical}. I call tmux-terminal-impl with "new-window -a" (instead of "new-window"), so make sure the fix works for my use case. I considered retrieving the tmux session ID from the $TMUX environment variable but the tmux manpage only specifies that $TMUX contains "some internal data".
2022-11-19rc repl tmux: do not record repl session/window since pane might moveJohannes Altmanninger
A pane's ID is immutable for the lifetime of the tmux server. Same with window/session IDs. When creating a new tmux repl, we record all three IDs to later use them to send text to the repl. The window/session IDs can be invalidating when a pane is moved to a different window/session (via "tmux move-pane", "tmux move-window" etc). This will cause repl-send-text to fail. Fix this by dropping the redundant and potentially incorrect window/session IDs. The immutable pane ID is enough.
2022-11-19rc repl tmux: remove bashismsJohannes Altmanninger
2022-11-19rc repl tmux: show error when the repl pane is goneJohannes Altmanninger
tmux-send-text would silently fail when the repl is no more. Let's instead print an error, pointing the user to the *debug* buffer which has tmux' stderr.
2022-07-28Merge remote-tracking branch 'krobelus/embrace-menu-2'Maxime Coste
2022-07-28Merge remote-tracking branch 'krobelus/tmux-repl-completion'Maxime Coste
2022-07-21rc windowing: use menu behavior for focusJohannes Altmanninger
We can complete every possible client argument.
2022-07-21rc repl: complete tmux-repl with shell commands, not Kakoune commandsJohannes Altmanninger
2022-07-16Also escape path and tmpdir in iterm.kakJeroen de Haas
This fixes an issue with where paths containing spaces would break iterm support
2022-06-02Support `focus` Within Sway WMDixiE
While Wayland offers nothing general to help us support `focus` on all window managers, WM-specific implementations are generally possible. Sway is a tiling window manager that mimics i3, and has a reasonably powerful CLI that can help us achieve this. In addition to supporting `focus` for Sway, this change paves the way for additional WM-specific Wayland functionality by adding a detection step to wayland.kak, in a similar fashion to detection.kak.
2022-03-06Add a complete-command command to configure command completionMaxime Coste
This makes it possible to change command completion in hooks and paves the way to more flexibility in how custom commands can be completed
2022-01-24Remove explicit fail in `new` commandMaxime Coste
That fail prevents the real error message from being displayed
2022-01-24Recognize foot as a wayland terminalMaxime Coste
2021-08-28Merge remote-tracking branch 'StatPal/master' into HEADMaxime Coste
2021-08-28Merge remote-tracking branch 'listentolist/x11-repl' into HEADMaxime Coste
2021-08-22In the tmux-repl, it tackles the situations where there is already some ↵Subrata
other tmux pane open and we want to send text (or do other works) in that specific pane.
2021-08-21add module `dtach-repl`Tilman List
2021-08-17Merge remote-tracking branch 'alexherbo2/fix-typos'Maxime Coste
2021-07-08Spawn a shell when using xfce4-terminalNulo
Previously, commands like repl broke because of this
2021-06-21Fix windowing detection priorityTaupiqueur
2021-06-13Fix typosTaupiqueur
2021-06-02fix: iterm focus client from different tab or windowGirish Kumar
currently focus client doesn't work if target pane of the client is in different tab or window from current one. select window, select tab should be triggered in order to select a pane on a currently not focused tab or window.
2021-04-24Fix issue with tmux.kak setting empty TMPDIR variableeli