Merge pull request 'feature(tmux): make tmux forward csi-u sequences thus enabling shift-enter in opencode' (#66) from feature/tmux into main
Reviewed-on: #66
This commit was merged in pull request #66.
This commit is contained in:
@@ -5,7 +5,7 @@ let
|
|||||||
#
|
#
|
||||||
# Written as escapes rather than literal glyphs. These are Private Use Area
|
# Written as escapes rather than literal glyphs. These are Private Use Area
|
||||||
# codepoints: they render only with a patched font, they survive copy/paste
|
# codepoints: they render only with a patched font, they survive copy/paste
|
||||||
# badly, and when they get stripped the loss is invisible -- the config still
|
# badly, and when they get stripped the loss is invisible, the config still
|
||||||
# parses, the status bar just quietly loses its separators. Nix has no \u
|
# parses, the status bar just quietly loses its separators. Nix has no \u
|
||||||
# escape of its own, but fromJSON does.
|
# escape of its own, but fromJSON does.
|
||||||
sep = builtins.fromJSON ''
|
sep = builtins.fromJSON ''
|
||||||
@@ -19,28 +19,27 @@ let
|
|||||||
in
|
in
|
||||||
{
|
{
|
||||||
programs.tmux = {
|
programs.tmux = {
|
||||||
|
# defaults
|
||||||
enable = true;
|
enable = true;
|
||||||
prefix = "C-a";
|
prefix = "C-a";
|
||||||
keyMode = "vi";
|
keyMode = "vi";
|
||||||
mouse = true;
|
mouse = true;
|
||||||
|
|
||||||
# tmux-256color gives truecolor, italics and undercurl in nvim.
|
# tmux-256color gives truecolor, italics and undercurl in nvim.
|
||||||
# screen-256color has none of them. No terminfo gymnastics needed here --
|
|
||||||
# unlike macOS, NixOS ships a current ncurses that has the entry.
|
|
||||||
terminal = "tmux-256color";
|
terminal = "tmux-256color";
|
||||||
|
|
||||||
# Default is 500ms. That is the lag you feel leaving insert mode in nvim,
|
# Default is 500ms. Causes lag you feel when leaving insert mode in nvim,
|
||||||
# because tmux is waiting to see whether Esc starts an escape sequence.
|
# because tmux is waiting to see whether Esc starts an escape sequence.
|
||||||
escapeTime = 10;
|
escapeTime = 10;
|
||||||
|
|
||||||
# nvim autoread / :checktime react to focus. home-manager defaults to false.
|
# nvim autoread / :checktime react to focus.
|
||||||
focusEvents = true;
|
focusEvents = true;
|
||||||
|
|
||||||
# Default is 2000.
|
# History limit.
|
||||||
historyLimit = 50000;
|
historyLimit = 50000;
|
||||||
|
|
||||||
# Window numbers matching the number row. Behaviour change, so opt in.
|
# Window numbers matching the number row.
|
||||||
# baseIndex = 1;
|
baseIndex = 1;
|
||||||
|
|
||||||
extraConfig = ''
|
extraConfig = ''
|
||||||
# Status keys
|
# Status keys
|
||||||
@@ -49,16 +48,15 @@ in
|
|||||||
# Tell tmux the outer terminal can do 24-bit colour (tmux >= 3.2).
|
# Tell tmux the outer terminal can do 24-bit colour (tmux >= 3.2).
|
||||||
set -sa terminal-features ",*:RGB"
|
set -sa terminal-features ",*:RGB"
|
||||||
|
|
||||||
# --- Shift+Enter / extended keys -----------------------------------
|
# Shift+Enter / extended keys
|
||||||
# Still the open topic; uncommenting these makes tmux forward CSI-u
|
# These make tmux forward CSI-u sequences unconditionally.
|
||||||
# sequences unconditionally. Needs tmux >= 3.5 for the format option,
|
# Needs tmux >= 3.5 for the format option,
|
||||||
# and a `tmux kill-server` afterwards -- a config reload is not enough.
|
set -s extended-keys always
|
||||||
#set -s extended-keys always
|
set -s extended-keys-format csi-u
|
||||||
#set -s extended-keys-format csi-u
|
set -as terminal-features '*:extkeys'
|
||||||
#set -as terminal-features '*:extkeys'
|
|
||||||
|
|
||||||
# Status bar options
|
# Status bar options
|
||||||
set -g status-interval 5 # was 1; the clock only has minute resolution
|
set -g status-interval 5
|
||||||
set -g status-justify left
|
set -g status-justify left
|
||||||
|
|
||||||
# Clock mode
|
# Clock mode
|
||||||
@@ -69,11 +67,9 @@ in
|
|||||||
set -g status-fg white
|
set -g status-fg white
|
||||||
|
|
||||||
# Key bindings
|
# Key bindings
|
||||||
# Reload configuration. tmux.conf is a read-only symlink into the nix
|
|
||||||
# store, so this only picks up changes after `home-manager switch`.
|
|
||||||
bind r source-file ~/.config/tmux/tmux.conf \; display-message "tmux.conf reloaded"
|
bind r source-file ~/.config/tmux/tmux.conf \; display-message "tmux.conf reloaded"
|
||||||
|
|
||||||
# Panel split and selection -- new panes/windows inherit the cwd
|
# Panel split and selection, new panes/windows inherit the cwd
|
||||||
unbind %
|
unbind %
|
||||||
unbind '"'
|
unbind '"'
|
||||||
bind v split-window -v -c "#{pane_current_path}"
|
bind v split-window -v -c "#{pane_current_path}"
|
||||||
@@ -88,7 +84,7 @@ in
|
|||||||
bind k select-pane -U
|
bind k select-pane -U
|
||||||
bind l select-pane -R
|
bind l select-pane -R
|
||||||
|
|
||||||
# Resize panes -- -r makes them repeatable, hold instead of re-prefixing
|
# Resize panes
|
||||||
bind -r H resize-pane -L 5
|
bind -r H resize-pane -L 5
|
||||||
bind -r J resize-pane -D 5
|
bind -r J resize-pane -D 5
|
||||||
bind -r K resize-pane -U 5
|
bind -r K resize-pane -U 5
|
||||||
@@ -96,7 +92,6 @@ in
|
|||||||
|
|
||||||
# Wayland clipboard integration
|
# Wayland clipboard integration
|
||||||
# Copy selection to both clipboard (Ctrl+V / Shift+Insert) and primary (middle-click)
|
# Copy selection to both clipboard (Ctrl+V / Shift+Insert) and primary (middle-click)
|
||||||
# v/C-v added: you had no way to *start* a selection from the keyboard.
|
|
||||||
bind -T copy-mode-vi v send-keys -X begin-selection
|
bind -T copy-mode-vi v send-keys -X begin-selection
|
||||||
bind -T copy-mode-vi C-v send-keys -X rectangle-toggle
|
bind -T copy-mode-vi C-v send-keys -X rectangle-toggle
|
||||||
bind -T copy-mode-vi y send-keys -X copy-pipe-and-cancel "wl-copy && wl-copy --primary"
|
bind -T copy-mode-vi y send-keys -X copy-pipe-and-cancel "wl-copy && wl-copy --primary"
|
||||||
@@ -107,7 +102,6 @@ in
|
|||||||
#set -g set-clipboard on
|
#set -g set-clipboard on
|
||||||
|
|
||||||
# Kill commands
|
# Kill commands
|
||||||
# Drop the `confirm-before -p "..."` part for the old single keystroke.
|
|
||||||
bind q confirm-before -p "kill window #W? (y/n)" kill-window
|
bind q confirm-before -p "kill window #W? (y/n)" kill-window
|
||||||
bind Q confirm-before -p "kill session #S? (y/n)" kill-session
|
bind Q confirm-before -p "kill session #S? (y/n)" kill-session
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user