From fe659f4386dbd425fb5818fab694d0a2331e1d34 Mon Sep 17 00:00:00 2001 From: Anton Volnuhin Date: Tue, 31 Mar 2026 01:04:13 +0300 Subject: [PATCH] mosh wrapper for kitty with forked mosh --- dot_terminfo/kitty.terminfo | 29 ++++++++++++++----- dot_terminfo/x/xterm-kitty | Bin 3398 -> 3721 bytes dot_tmux.conf | 8 +++++ private_dot_config/private_fish/config.fish | 21 ++++++++++++++ private_dot_config/private_fish/fish_plugins | 2 +- 5 files changed, 51 insertions(+), 9 deletions(-) diff --git a/dot_terminfo/kitty.terminfo b/dot_terminfo/kitty.terminfo index 96de693..de8c481 100644 --- a/dot_terminfo/kitty.terminfo +++ b/dot_terminfo/kitty.terminfo @@ -1,7 +1,9 @@ xterm-kitty|KovIdTTY, Su, Tc, + XF, am, + bw, ccc, fullkbd, hs, @@ -16,10 +18,23 @@ xterm-kitty|KovIdTTY, it#8, lines#24, pairs#32767, + BD=\E[?2004l, + BE=\E[?2004h, + Cr=\E]112\007, + Cs=\E]12;%p1%s\007, + Ms=\E]52;%p1%s;%p2%s\E\\, + PE=\E[201~, + PS=\E[200~, + RV=\E[>c, + Se=\E[2\sq, + Setulc=\E[58:2:%p1%{65536}%/%d:%p1%{256}%/%{255}%&%d:%p1%{255}%&%d%;m, Smulx=\E[4:%p1%dm, + Ss=\E[%p1%d\sq, Sync=\EP=%p1%ds\E\\, + XR=\E[>0q, acsc=++\,\,--..00``aaffgghhiijjkkllmmnnooppqqrrssttuuvvwwxxyyzz{{||}}~~, bel=^G, + blink=\E[5m, bold=\E[1m, cbt=\E[Z, civis=\E[?25l, @@ -42,11 +57,13 @@ xterm-kitty|KovIdTTY, dim=\E[2m, dl=\E[%p1%dM, dl1=\E[M, - dsl=\E]2;\007, + dsl=\E]2;\E\\, ech=\E[%p1%dX, ed=\E[J, el=\E[K, el1=\E[1K, + fd=\E[?1004l, + fe=\E[?1004h, flash=\E[?5h$<100/>\E[?5l, fsl=^G, home=\E[H, @@ -125,12 +142,8 @@ xterm-kitty|KovIdTTY, kUP5=\E[1;5A, kUP6=\E[1;6A, kUP7=\E[1;7A, - ka1=, - ka3=, kbeg=\EOE, kbs=\177, - kc1=, - kc3=, kcbt=\E[Z, kcub1=\EOD, kcud1=\EOB, @@ -201,7 +214,6 @@ xterm-kitty|KovIdTTY, kf7=\E[18~, kf8=\E[19~, kf9=\E[20~, - khlp=, khome=\EOH, kich1=\E[2~, kind=\E[1;2B, @@ -209,7 +221,8 @@ xterm-kitty|KovIdTTY, knp=\E[6~, kpp=\E[5~, kri=\E[1;2A, - kund=, + kxIN=\E[I, + kxOUT=\E[O, oc=\E]104\007, op=\E[39;49m, rc=\E8, @@ -232,7 +245,7 @@ xterm-kitty|KovIdTTY, setaf=\E[%?%p1%{8}%<%t3%p1%d%e%p1%{16}%<%t9%p1%{8}%-%d%e38;5;%p1%d%;m, setrgbb=\E[48:2:%p1%d:%p2%d:%p3%dm, setrgbf=\E[38:2:%p1%d:%p2%d:%p3%dm, - sgr=%?%p9%t\E(0%e\E(B%;\E[0%?%p6%t;1%;%?%p2%t;4%;%?%p1%p3%|%t;7%;%?%p4%t;5%;%?%p7%t;8%;m, + sgr=%?%p9%t\E(0%e\E(B%;\E[0%?%p6%t;1%;%?%p2%t;4%;%?%p1%p3%|%t;7%;%?%p4%t;5%;%?%p7%t;8%;%?%p5%t;2%;m, sgr0=\E(B\E[m, sitm=\E[3m, smacs=\E(0, diff --git a/dot_terminfo/x/xterm-kitty b/dot_terminfo/x/xterm-kitty index cee3d582fada1493b2a09a1a92ac50ba43598471..0cdac6c99156518f5a5e364c6a26dafd1d9f3dd1 100644 GIT binary patch delta 1220 zcmY*Xe@xV682^0U_dP8z9ZWGfA;Z2*EaL9u7;(l42uMu1JQD0Q9NZy{BM1(GDcoEm z%3@h3Td?KIa$}aONojw`(q`7O=_+fpAL|FU7EQNoEv?wM_j@4KcklZ=pU?9=d*1i+ zecrRFPo-s~atW4W5t=z+>xqOqTC-c4Baz-cm2JB!g4NYq!R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@VmOj94jGt&Y~;a*LX@BqYp@YpumgK>07tb*=Wzw~xQj=4j@NjP z&uBywY%NJA#ZFCqcJ8R6H}3e9Lz&LmZAuy8YY1C*o+$N)OH`h5u89!16{&(+`>JL^b9ZY z79a2xKQ)wL8*Oe3doW&O4Puh^HeoEAOFNyjm`fl1^vq34_AVdl_32-mni68Ap4_0_ kb{n1A$h3}&%l-bsg+9zED)(1lM&+{nptoHro#Lq2KafvpUjP6A diff --git a/dot_tmux.conf b/dot_tmux.conf index f4cc979..6622ab4 100644 --- a/dot_tmux.conf +++ b/dot_tmux.conf @@ -14,6 +14,8 @@ bind C-a send-prefix -2 bind r source-file ~/.tmux.conf \; display '~/.tmux.conf sourced' set -g default-terminal "tmux-256color" set -s set-clipboard external +set -s extended-keys on +set -s extended-keys-format csi-u set -as terminal-features ",xterm-kitty:RGB" set -as terminal-features ",xterm-kitty:clipboard" set -as terminal-features ",xterm-kitty:extkeys" @@ -22,6 +24,10 @@ set -as terminal-features ",xterm-ghostty:RGB" set -as terminal-features ",xterm-ghostty:clipboard" set -as terminal-features ",xterm-ghostty:extkeys" set -as terminal-features ",xterm-256color:RGB" +set -as terminal-features ",xterm-256color:extkeys" +set -as terminal-features ",xterm-kitty:hyperlinks" +set -as terminal-features ",xterm-ghostty:hyperlinks" +set -as terminal-features ",xterm-256color:hyperlinks" set -as terminal-overrides ",xterm-256color:Ms=\E]52;c;%p2%s\007" set -as terminal-overrides ",screen-256color:Ms=\E]52;c;%p2%s\007" set -g allow-passthrough on @@ -39,6 +45,8 @@ bind-key -T copy-mode-vi v send-keys -X begin-selection bind-key -T copy-mode-vi C-v send-keys -X rectangle-toggle bind-key -T copy-mode-vi Enter send-keys -X copy-pipe-and-cancel '$HOME/.local/bin/yank-osc52 > #{pane_tty}' bind-key -T copy-mode-vi y send-keys -X copy-pipe-and-cancel '$HOME/.local/bin/yank-osc52 > #{pane_tty}' +bind-key -T copy-mode-vi WheelUpPane select-pane \; send-keys -N 1 -X scroll-up +bind-key -T copy-mode-vi WheelDownPane select-pane \; send-keys -N 1 -X scroll-down bind-key -T copy-mode-vi MouseDragEnd1Pane send-keys -X copy-pipe-and-cancel '$HOME/.local/bin/yank-osc52 > #{pane_tty}' bind-key -T copy-mode-vi DoubleClick1Pane send-keys -X select-word \; run-shell -b 'sleep 0.2; tmux send-keys -X -t "#{pane_id}" copy-pipe-and-cancel "$HOME/.local/bin/yank-osc52 > #{pane_tty}"' bind-key -T copy-mode-vi TripleClick1Pane send-keys -X select-line \; run-shell -b 'sleep 0.2; tmux send-keys -X -t "#{pane_id}" copy-pipe-and-cancel "$HOME/.local/bin/yank-osc52 > #{pane_tty}"' diff --git a/private_dot_config/private_fish/config.fish b/private_dot_config/private_fish/config.fish index 25df07c..9e07bd5 100644 --- a/private_dot_config/private_fish/config.fish +++ b/private_dot_config/private_fish/config.fish @@ -11,6 +11,7 @@ set -gx EDITOR nvim set fish_color_valid_path set -g fish_greeting + if test -S ~/.1password/agent.sock set -gx SSH_AUTH_SOCK ~/.1password/agent.sock end @@ -22,6 +23,18 @@ end # Commands to run in interactive sessions can go here if status is-interactive + set -l kitty_fish_integration /Applications/kitty.app/Contents/Resources/kitty/shell-integration/fish/vendor_conf.d/kitty-shell-integration.fish + set -l kitty_fish_completions /Applications/kitty.app/Contents/Resources/kitty/shell-integration/fish/vendor_completions.d + if test -f "$kitty_fish_integration" + if test "$TERM" = xterm-kitty; or set -q KITTY_MOSH + set -g KITTY_SHELL_INTEGRATION enabled + source "$kitty_fish_integration" + if test -d "$kitty_fish_completions" + set --prepend fish_complete_path "$kitty_fish_completions" + end + end + end + if type -q atuin; and test -s ~/.local/share/atuin/key atuin init fish --disable-up-arrow | source end @@ -68,6 +81,14 @@ function s end end +function mosh + if contains -- -- $argv + command mosh $argv + else + command mosh $argv -- env KITTY_MOSH=1 sh -lc 'exec "${SHELL:?}" -l' + end +end + function icat if test "$TERM_PROGRAM" = "WezTerm" wezterm imgcat $argv diff --git a/private_dot_config/private_fish/fish_plugins b/private_dot_config/private_fish/fish_plugins index a0c74a0..50b08c8 100644 --- a/private_dot_config/private_fish/fish_plugins +++ b/private_dot_config/private_fish/fish_plugins @@ -8,5 +8,5 @@ patrickf1/colored_man_pages.fish jhillyerd/plugin-git patrickf1/fzf.fish lilyball/nix-env.fish -antonme/tide edc/bass +~/dev/tide