From tmux and tmuxifier to kitty native features #8483
Replies: 9 comments 9 replies
-
just swap the order. unless you rely on some bash env. |
Beta Was this translation helpful? Give feedback.
-
On Thu, Mar 27, 2025 at 11:32:32AM -0700, Luis Marques wrote:
I'm trying to move from tmux and tmuxifier to kitty native features, and I'm struggling with some features.
Issue Number 1: I want to launch a terminal with my i3 config, which launches no particular session, then I want to execute a session in the same OS window, just like when calling tmuxifier s <session>. Is there a way to do with only the first terminal, no remote control ?
I dont know what that means, elaborate.
Issue Number 2: Suppose I have a kitty terminal running. Is there a way to launch a session, perhaps like in issue number 1, perhaps in the background if possible, then launch another and nagivate them like tmux ? My ultimate goal is to have a single terminal that can connect to all my running sessions, just like tmux.
Sure use remote control, and no you dont have to turn on remote control
globally for this, write a simple custom kitten that uses the remote
control API to list OS windows or tabs or whatever you want to use for a
a "session".
Issue Number 3: Suppose the following session file:
```
layout grid
cd /mnt/office/coppermind
launch bash
cd /mnt/office/coppermind/dailylife
launch "bash; nvim todo.md"
launch nvim todo.md
```
In line `launch "bash; nvim todo.md"`, I'm trying to launch neovim in bash, because if I launch only neovim, then when quitting it the window closes, and often it would be better to have that window remain open with bash. I have also tried `launch "bash && nvim todo.md"`
Is this possible ?
launch --hold nvim
|
Beta Was this translation helpful? Give feedback.
-
On Thu, Mar 27, 2025 at 10:51:54PM -0700, Luis Marques wrote:
> I dont know what that means, elaborate.
Suppose I just opened a kitty terminal. If I execute kitty --session <some session>, I want it to override the current terminal, not open a new OS window.
So dont use kitty --session, use remote control instead. Run a script
with
kitten @ launch --cwd=your-dir --type=tab
...
finally in the script run the following which will close the currently
open window.
kitten @ close-window --match id:$KITTY_WINDOW_ID
> Sure use remote control, and no you dont have to turn on remote control globally for this, write a simple custom kitten that uses the remote control API to list OS windows or tabs or whatever you want to use for a a "session".
It feels like I need to have two terminals open for that. Am I mistaken ? I will look further into remote control.
See above.
> launch --hold nvim
Thank you, it's what I was looking for, modulo a minor inconvenience. For example, once you leave nvim, I still have the terminal and bash running, but the nvim command that was launched is not in its history.
Why would it be in its history? You aren't running it via the
shell. If you want to do that, do something like
launch sh -c "nvim; some-code to add nvim to shell history; kitten run-shell"
|
Beta Was this translation helpful? Give feedback.
-
On Thu, Mar 27, 2025 at 11:03:34PM -0700, Luis Marques wrote:
> You aren't running it via the shell.
Because when I quit nvim I'm back in the shell, so I though it was launched via the shell, as if Kitty --hold launches a shell than the command. How does --hold work exactly ?
Read it's docs.
|
Beta Was this translation helpful? Give feedback.
-
On Thu, Mar 27, 2025 at 11:09:35PM -0700, Luis Marques wrote:
"Keep the window open even after the command being executed exits, at a shell prompt."
How does it work exactly ? Why is the command not launched in the created shell ?
It runs the command you specify for launch, then when that command exits
it runs the shell. Read up on how shells work. You cannot run a command
in a shell and then enter it in interactive mode.
|
Beta Was this translation helpful? Give feedback.
-
On Thu, Mar 27, 2025 at 11:17:00PM -0700, Luis Marques wrote:
I see, but you could first run the interactive shell and forward the command to it right ?
Why and how would I do that? You cannot forward commands to a shell
unless the shell has some dedicated mechanism to accept that, and this
functionality has to work with *arbitrary* shells. The best you could
hope to do is try to send a command as text over the tty and then send
the enter key, which is *extremely* fragile.
|
Beta Was this translation helpful? Give feedback.
-
I think I am almost where I want, but there are stil two points I'd like to work on.
|
Beta Was this translation helpful? Give feedback.
-
On Fri, Mar 28, 2025 at 01:28:42PM -0700, Luis Marques wrote:
I think I am almost where I want, but there are stil two points I'd like to work on.
1. If I understand correctly, only windows have titles. Am I correct or do tabs also have titles ? If tabs also have titles, is it possible to have tab_bar display the tab title instead of the window title that changes on focus ?
2. I have a line like this in my session script: `kitten @ launch --cwd ~/directory --title "Sheets" --hold ls *.jsonl`, but haven't been able to display the files that end in .jsonl. How do I do something like this ?
launch sh -c "ls *.whatever"
ls doesnt support wildcards, they are expanded by your shell.
|
Beta Was this translation helpful? Give feedback.
-
On Fri, Mar 28, 2025 at 10:45:24PM -0700, Luis Marques wrote:
Also, since you consider multiplexers to be a very bad thing, you should know that I have just spent two evenings trying to move from tmux and tmuxifier to kitty native features. And I was motivated to do so. I think a section in the docs that show how to use kitty as if you were using tmux would help users realise how complete kitty is.
That would require someone that used to use a multiplexer and moved to kitty to
contribute such a writeup. As I have never used multiplexers I am not
the write person to do that. That said if you Google you will find
plenty of writeups from people having made the same move.
|
Beta Was this translation helpful? Give feedback.
-
I'm trying to move from tmux and tmuxifier to kitty native features, and I'm struggling with some features.
Issue Number 1: I want to launch a terminal with my i3 config, which launches no particular session, then I want to execute a session in the same OS window, just like when calling tmuxifier s . Is there a way to do with only the first terminal, no remote control ?
Issue Number 2: Suppose I have a kitty terminal running. Is there a way to launch a session, perhaps like in issue number 1, perhaps in the background if possible, then launch another and nagivate them like tmux ? My ultimate goal is to have a single terminal that can connect to all my running sessions, just like tmux.
Issue Number 3: Suppose the following session file:
In line
launch "bash; nvim todo.md"
, I'm trying to launch neovim in bash, because if I launch only neovim, then when quitting it the window closes, and often it would be better to have that window remain open with bash. I have also triedlaunch "bash && nvim todo.md"
Is this possible ?
Beta Was this translation helpful? Give feedback.
All reactions