-
|
I can use the |
Beta Was this translation helpful? Give feedback.
Replies: 4 comments 5 replies
-
|
There is no command to only detach a window, there are commands to
detach and reattach windows. See https://sw.kovidgoyal.net/kitty/overview/#windows
If you mean in a kitten using kitty API see
the kitty source code for how the detach_window command is implemented.
|
Beta Was this translation helpful? Give feedback.
-
The reason why you didn't find the appropriate action is probably because you haven't figured out the kitty window terms yet.
https://sw.kovidgoyal.net/kitty/overview/#windows Press the shortcut on the tab you want to "reattach" and select the desired OS window. |
Beta Was this translation helpful? Give feedback.
-
|
This is a script for Hyprland that merges Kitty OS windows. It does not support nested shells like SSH, though (better use Kitty + Tmux for things like this). #!/bin/bash
# Generated by Claude Sonnet 4.5, partially edited.
#
# DISCLAIMER: This script is provided as-is, without warranty of any kind.
# I am not responsible for any data loss, session loss, or damage
# arising from its use. Review and test before using in production.
# REQUIREMENTS:
# - Hyprland (hyprctl)
# - kitty with: allow_remote_control socket-only (or yes)
# - kitty with: listen_on unix:/tmp/kitty (must match SOCKET below)
# - fzf, jq, python3
# kittyMergeWindows.sh
# Merges current kitty window's (all) tabs into a selected kitty window via fzf overlay
SOCKET="/tmp/kitty"
SOCKET_FULL="unix:$SOCKET"
CURRENT_SOCKET="$KITTY_LISTEN_ON"
if [ -z "$CURRENT_SOCKET" ]; then
echo "❌ Not running inside a kitty window"
exit 1
fi
# Build fzf list of other kitty windows
SELECTION=$(hyprctl clients -j | jq -r '
.[] | select(.class == "kitty") | "\(.pid)\t[\(.workspace.name)] \(.title)"
' | while IFS=$'\t' read -r pid label; do
socket="${SOCKET_FULL}-${pid}"
if [ -S "${SOCKET}-${pid}" ] && [ "$socket" != "$CURRENT_SOCKET" ]; then
echo -e "${pid}\t${label}"
fi
done | fzf --prompt="Merge into > " --with-nth=2 --delimiter='\t')
[ -z "$SELECTION" ] && exit 0
TARGET_PID=$(echo "$SELECTION" | cut -f1)
TARGET_SOCKET="${SOCKET_FULL}-${TARGET_PID}"
kitten @ --to "$CURRENT_SOCKET" ls | python3 -c "
import sys, json, os
# Only exclude self when launched as overlay (parent process is kitty)
is_overlay = '$(ps -p $PPID -o comm=)' == 'kitty'
current_id = int(os.environ.get('KITTY_WINDOW_ID', -1)) if is_overlay else -1
data = json.load(sys.stdin)
for os_win in data:
for tab in os_win['tabs']:
for win in tab['windows']:
if win['id'] != current_id:
print(win['cwd'])
" | while IFS= read -r cwd; do
kitten @ --to "$TARGET_SOCKET" launch --type=tab --cwd="$cwd"
done
CURRENT_PID=$(echo "$CURRENT_SOCKET" | grep -o '[0-9]*$')
hyprctl dispatch focuswindow "pid:${TARGET_PID}"
hyprctl dispatch closewindow "pid:${CURRENT_PID}"
kitty.conf: |
Beta Was this translation helpful? Give feedback.
-
|
On Thu, Mar 12, 2026 at 12:27:28PM -0700, EndermanbugZJFC wrote:
Hi, I would like to know if there are easy ways to combine two **OS windows** into one. When I do `detach_tab ask`, it doesn't detect my other OS windows:
As long as your two OS Windows are from the same kitty *instance* they
will be detected just fine. Not to mention that as of kitty 0.46 you can simply drag and drop tabs to move them between OS windows (again from the same kitty process/instance)
|
Beta Was this translation helpful? Give feedback.


The reason why you didn't find the appropriate action is probably because you haven't figured out the kitty window terms yet.
https://sw.kovidgoyal.net/kitty/glossary/
https://sw.kovidgoyal.net/kitty/overview/#windows
Press the shortcut on the tab you want to "reattach" and select the desired OS window.