Replication of tmux sessions to kitty (2 flavours - os windows or tabs) #5426
Replies: 5 comments 5 replies
-
You dont need to use kitty @ ls, you can just do
for os_window in boss.list_os_windows():
os_window is a dict with the wm_class, id etc keys
|
Beta Was this translation helpful? Give feedback.
-
Oh and if you dont want new os windows, you can use the detach_tab function to move them into an existing one. |
Beta Was this translation helpful? Give feedback.
-
@megalithic you might've just made my day with the mention. ❤️ For what it's worth, I've been exploring another session management solution. Perhaps it'll fit your needs, perhaps not. I do like fzf too. The idea is to use tabs as namespaces, instead of windows:
Yolo'd fish function, which is usually invoked by pressing function kt -d "kitty tab from ~/Dev/*"
set -l path $HOME/Dev
set -l selected_dir (
find $path/* -maxdepth 1 -mindepth 1 -type d |
sed "s~$path/~~" |
fzf-tmux -p --cycle --layout=reverse --prompt 't> ' |
sed "s~^~$path/~"
)
if test -n "$selected_dir"
set -l tab_name (echo $selected_dir | sed "s~$path/~~")
kitty @ focus-tab --match title:$tab_name 2>/dev/null || kitty @ new-window --new-tab --tab-title $tab_name --cwd $selected_dir
end
end |
Beta Was this translation helpful? Give feedback.
-
MINOR UPDATE: for anyone following along and wishing i'd get this thing wrapped up (me included); i've hit a roadblock and not able to debug the suggestions from Mr. Goyal. I'll have to come back around to it later when I get some time to do some more reading on python things. |
Beta Was this translation helpful? Give feedback.
-
ok ONE more update; i've gone back to both @muchzill4 and @tg0h's usages of "tabs" as sessions/workspaces/etc.. while it's not perfect, it has avoided certain overheads and oddities.. so, with that said, we have a modified version of @muchzill4's fish function: https://github.com/megalithic/dotfiles/blob/main/bin/kt It does a lot of the same things, but moves to using I'm then using some additional nvim plugins/behaviours to let me bring the rest of my terminal interactions into nvim splits and stuff (and us their session managment and workspace functionality) |
Beta Was this translation helpful? Give feedback.
-
Hi!
Like many of you, I've been looking for ways to mimick certain functionality of tmux, but within kitty (effectively ditching tmux completely from my flow -- well, sort of -- more on that later).
I've based this off of the incredible work of @muchzill4 to provide a pre-created list of sessions and select via fzf (his version was an up/down arrow native selector thingy -- i'm so used to fzf'ing all the things):
This will only spawn "session" files as new os_windows.
What's left, is to have it determine if one is already launched, and instead, switch to it, instead of launching a new one all the time. I'll need to figure out how to parse
kitty @ ls
to get the wm_class/wm_names and even the window_platform_ids for comparison and later use with hammerspoon.Lastly, you might be asking "what about the getting rid of tmux completely, sort of"?
I still use tmux for attaching/detaching to long-running process that might need to be shared between "kitty session launches"; for me that includes
weechat
, andexpo
, and myslack
script's output. So I just have a separate script (tmux-launch
) in my dotfiles that handles this particular behaviour.If I can just get the "switch to already open os_window" part going, I'll be close (though, I hate having multiple OS windows going like this; as it clutters things in a weird way).
Many folks to thank in this community.
Beta Was this translation helpful? Give feedback.
All reactions