summaryrefslogtreecommitdiff
path: root/rc/windowing/repl
AgeCommit message (Collapse)Author
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-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.
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 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-21rc repl: complete tmux-repl with shell commands, not Kakoune commandsJohannes Altmanninger
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
2021-08-28Merge remote-tracking branch 'StatPal/master' 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-03-11make kitty repl command consistent with other kitty commandsbasbebe
2021-02-05rc repl x11: do not send new lineMatthew Forrester
The X11 repl is unique in that it sends the selection (or parameter) with a new line appended. This patch removes that new line and thus, brings it into line with the tmux and kitty versions.
2021-01-16rc repl x11: allow arg for repl send & refocus kakMatthew Forrester
tmux-send-text allows sending an argument, when supplied the argument will be sent to the REPL instead of the current selection. tmux-send-text also keeps kak focussed, which does not happen in the x11 variant as it uses xdotool to switch window. this patch allows: * Passing an argument to x11-send-text, so that value will be sent instead of the current selection. * We capture the window id of the current (presumably kak window) before we use xdotool to switch window. We can therefore switch back to kak afterwards (which we do)
2020-12-30Update tmux.kakHao Deng
When $1 or ${kak_selection} start with dash, like "-1", the command will fail, because tmux think it's an argument flag. -- prevent this. Also the doc (append new line) is no longer valid.
2020-11-08Merge remote-tracking branch 'listentolist/tmux-repl' into masterMaxime Coste
2020-10-30if the $WINDOWID is not set, use xdotool to get the window idTilman List
2020-10-30simplify x11-repl by using x11-terminalTilman List
2020-10-27changed scope of `tmux_repl_id` from `global` to `current`Tilman List
By setting the tmux_repl_id in the `current` scope it is possible to have different REPLs for different buffers or windows.
2020-10-27changed the way the x11 REPL interaction worksTilman List
Now it uses the window id to identify the REPL window. It is stored in the option x11_repl_id. That way it is possible to have different REPLs for different buffers or windows.
2020-09-01rc repl: Normalise REPL commandsFrank LENORMAND
It's unclear what the `send-text` alias does at first glance, so prefixing it with "repl-" both fixes that and helps make it discoverable via the command prompt's fuzzy matcher. The `repl` alias also seems too generic a name, the "-new" suffix should hopefully give a hint that it creates a new window.
2020-08-30Allow multiple arguments in tmux replMaxime Coste
Fixes #3680
2020-07-28rc/x11: failure message when some external tools are missingJohannes Altmanninger
Addresses #3591
2020-07-03finetuned the :send-text commandPhilman
See discussions on [github](https://github.com/philgee1981/kakoune/pull/1) and on [the kakoune message board](https://discuss.kakoune.com/t/trying-to-run-kakoune-repl-with-st-and-dwm/1122/3)
2020-04-27Split modules and allow kitty-send-text to take a parameterJason Felice
2020-02-03rc: Make docstrings more readableFrank LENORMAND
This cosmetics commit makes use of the auto-deindentation syntax, available to docstrings.
2019-12-10rc repl tmux: Do not check for the Tmux versionFrank LENORMAND
This commit removes attempts to auto-detect the version of the local Tmux binary. The Tmux package that ships with OpenBSD doesn't have a version number[1], and therefore doesn't provide any way to check if it's compatible with the REPL module, making the feature disabled by default in that distribution. Fixes #3237. [1] https://github.com/tmux/tmux/issues/1141#issuecomment-340244302
2019-11-14rc: Use the standard `fail` command to report errorsFrank LENORMAND
Merely using `echo` with markup doesn't log errors in the debug buffers, and is also less readable.
2019-10-22Accept tmux pre-release and rc versionsJason Felice
2019-06-25Rename ModuleLoad hook to ModuleLoadedcodesoap
This clarifies, that the hook is run *after* the module is loaded.
2019-06-18Comment on the escape sequence for setting the terminal's titlecodesoap
2019-06-18Print escape sequence to set the window titlecodesoap
Using xdotool was probably a little less portable, because it relied on the newly created window to be activated by the window manager.
2019-06-18Set the REPL window title using xdotoolcodesoap
As mentioned in issue #2973, the -t argument for setting the terminal title was not very portable.
2019-04-08Added modules to extra filesJustin Frank
2019-03-21Add windowing/repl categoryAlex Leferry 2