Author SHA1 Message Date
branderson cd06db0274 Merge pull request 'Scroll copy mode 4 lines per mouse wheel tick instead of half a page' (#8) from tmux-wheel-scroll-4 into master
Reviewed-on: #8
Reviewed-by: branderson <brad@branderson.io>
2026-09-02 18:58:20 -07:00
branderson eacaebfdef Scroll copy mode 4 lines per mouse wheel tick instead of half a page 2026-09-02 18:32:22 -07:00
branderson b0a2f0b132 Merge pull request 'Fix basedpyright install failure on Debian' (#7) from nvim-basedpyright-venv into master
Reviewed-on: #7
Reviewed-by: branderson <brad@branderson.io>
2026-08-17 14:42:55 -07:00
branderson 237a56fb6c Fix basedpyright install failure on Debian
Debian ships venv's ensurepip in a separate python3-venv package. Without
it, `python3 -m venv` exits 1, so mason cannot build the venv it installs
basedpyright into, and mason-lspconfig reports a failed install on every
startup.

Add python3-venv to the apt package list, and guard the basedpyright entry
in ensure_installed the same way the npm-sourced servers are already
guarded, so a machine missing it gets one warning instead of a failed
install every time.
2026-08-17 14:36:39 -07:00
branderson 7849b91f06 Merge pull request 'Fix multi-line paste corruption in nested tmux on 3.5/3.5a' (#6) from tmux-extended-keys-paste into master
Reviewed-on: #6
Reviewed-by: branderson <brad@branderson.io>
2026-08-17 14:27:55 -07:00
branderson 123c68dbae Fix multi-line paste corruption in nested tmux on 3.5/3.5a
Pasting multi-line text into a tmux session reached over ssh from inside
another tmux replaced every newline with a literal CSI 27;5;106~, i.e.
C-j -- the pasted newline -- rendered in modifyOtherKeys form rather than
sent as a newline.

tmux 3.5 rewrote extended-key handling and encodes keys inside a
bracketed paste; the layer further in passes those bytes through verbatim
instead of decoding them, so the application receives the escape as text.
A hop only corrupts when whatever sits downstream of it has asked for
modifyOtherKeys mode 2. A nested tmux always asks, because of the
"*:extkeys" terminal-feature above it; an application running directly
under screen-256color generally does not. That is why one tmux in the
chain was fine and two were not.

Confirmed by building 3.2a, 3.3a, 3.4, 3.5a, 3.6b and 3.7c and driving a
real bracketed paste through a pty into every outer/inner combination:
only 3.5 and 3.5a corrupt, and only on the requesting hop. Fixed upstream
in 3.6, so upgrading is the real answer where it is available.

For hosts pinned to a distro tmux, disable extended keys on exactly those
two versions. Nothing narrower works: extended-keys-format csi-u only
changes which escape lands in the text, and withholding the extkeys
terminal-feature stops a tmux asking its own parent for extended keys
without stopping it encoding them for its pane. With the guard in place
all sixteen version combinations paste correctly, and extended keys stay
on everywhere except 3.5/3.5a.

The guard tests the version with an awk END block rather than a bare
exit, so that empty input -- a tmux -V that failed for any reason --
leaves extended keys on instead of silently disabling them.

Also corrects the comment that attributed this to a Claude Code paste
tokenizer bug. It reproduces just as readily pasting into neovim.
2026-08-17 14:20:42 -07:00
branderson 86d19db1e9 Merge pull request 'Open Claude Code in its own tab on dejima auto-start' (#5) from nvim-claude-tab into master
Reviewed-on: #5
Reviewed-by: branderson <brad@branderson.io>
2026-08-10 14:14:56 -07:00
5 changed files with 49 additions and 10 deletions
+18 -1
View File
@@ -1,4 +1,21 @@
local servers = { "basedpyright", "ruff" }
-- ruff is a prebuilt GitHub release binary, but mason installs basedpyright
-- from PyPI into a venv. Debian ships venv's ensurepip separately
-- (python3-venv), and without it every startup fails the install.
local servers = { "ruff" }
local function has_python_venv()
if vim.fn.executable("python3") ~= 1 then
return false
end
vim.fn.system({ "python3", "-c", "import ensurepip" })
return vim.v.shell_error == 0
end
if has_python_venv() then
table.insert(servers, "basedpyright")
else
vim.notify("python3 venv unavailable (install python3-venv): skipping LSP server basedpyright", vim.log.levels.WARN)
end
local npm_servers = { "ts_ls", "svelte", "html", "cssls", "bashls" }
local function has_public_npm()
+18 -5
View File
@@ -87,13 +87,26 @@ if-shell "tmux -V | awk '{print $2}' | awk -F. '{if ($1*1000+$2 >= 3003) exit 0;
# itself using default-terminal above (screen-256color) -- 'xterm*' would
# never match that, breaking the nested case this is meant to support.
#
# Investigated as a suspect for multi-line paste getting corrupted with
# literal CSI 27;<mod>;<key>~ garbage in place of newlines (see Claude Code
# issues #43169 and #30239) -- turning this off did not fix that paste
# corruption, so it's an upstream Claude Code paste-tokenizer bug, not
# something caused by this setting. Restored.
# Not the cause of multi-line paste arriving with literal CSI 27;5;106~ in
# place of each newline (that being C-j, the pasted newline, in
# modifyOtherKeys form). That is a tmux 3.5/3.5a bug: 3.5 rewrote extended-key
# handling and encodes keys inside a bracketed paste, which the layer further
# in then passes through verbatim rather than decoding. Reproduced against
# 3.2a/3.3a/3.4/3.5a/3.6b/3.7c -- only 3.5 and 3.5a corrupt, and only on a hop
# whose downstream has asked for modifyOtherKeys mode 2, which a nested tmux
# always does and a bare application under screen-256color generally doesn't.
# Hence it shows up with tmux at both ends of the ssh and not with one.
# Fixed upstream in 3.6, so upgrade the offending layer where that's possible.
if-shell "tmux -V | awk '{print $2}' | awk -F. '{if ($1*1000+$2 >= 3002) exit 0; else exit 1}'" 'set -s extended-keys on; set -as terminal-features "*:extkeys"'
# Where it isn't -- a host pinned to a distro tmux -- give the paste back on
# just those two versions. Nothing narrower helps: csi-u format only changes
# which escape lands in the text, and withholding the extkeys feature above
# stops this tmux asking its own parent for extended keys without stopping it
# encoding them for the pane. Turning them off is the whole of the workaround,
# and confining it to 3.5/3.5a keeps them everywhere else.
if-shell "tmux -V | awk '{hit = ($2 ~ /^3[.]5/)} END {exit hit ? 0 : 1}'" 'set -s extended-keys off'
# Accept pane-originated OSC 52 clipboard-set attempts into a real tmux
# buffer. Only on-vs-off matters here -- off would refuse to even look at
# these escapes; "on" (rather than "external") is needed so the pane-set-
+5 -2
View File
@@ -4,8 +4,11 @@
bind-key -t vi-copy PPage page-up
bind-key -t vi-copy NPage page-down
bind-key -t vi-copy WheelUpPane halfpage-up
bind-key -t vi-copy WheelDownPane halfpage-down
# Mouse wheel scrolls 4 lines per tick, not tmux's half-page default (20 lines
# in a 40-line pane). Old bind-key has no -N; -R is the equivalent repeat
# count for keys in the copy-mode tables.
bind-key -R 4 -t vi-copy WheelUpPane scroll-up
bind-key -R 4 -t vi-copy WheelDownPane scroll-down
bind-key -t vi-copy v begin-selection
bind-key -t vi-copy y copy-pipe "$HOME/dotfiles/bin/clipboard-copy"
unbind-key -t vi-copy Enter
+5 -2
View File
@@ -3,8 +3,11 @@
bind-key -T copy-mode-vi PPage send-keys -X page-up
bind-key -T copy-mode-vi NPage send-keys -X page-down
bind-key -T copy-mode-vi WheelUpPane send-keys -X halfpage-up
bind-key -T copy-mode-vi WheelDownPane send-keys -X halfpage-down
# Mouse wheel scrolls 4 lines per tick, not tmux's half-page default (20 lines
# in a 40-line pane). -N is the repeat count; scroll-up/scroll-down take no
# direct amount argument and tmux resets the count after each command.
bind-key -T copy-mode-vi WheelUpPane send-keys -X -N 4 scroll-up
bind-key -T copy-mode-vi WheelDownPane send-keys -X -N 4 scroll-down
bind-key -T copy-mode-vi v send-keys -X begin-selection
bind-key -T copy-mode-vi y send-keys -X copy-pipe "$HOME/dotfiles/bin/clipboard-copy"
unbind-key -T copy-mode-vi Enter
+3
View File
@@ -6,6 +6,9 @@ powerline
thefuck
tree
nodejs
# Debian splits venv's ensurepip out of python3; mason needs `python3 -m venv`
# to install PyPI-sourced LSP servers (basedpyright)
python3-venv
zsh
htop
jq