From 74c622efab5cbfbcbdf9722ae3c5a69fd5538282 Mon Sep 17 00:00:00 2001
From: Daniel Lundin <dln@arity.se>
Date: Tue, 19 Nov 2024 12:51:08 +0100
Subject: [PATCH] tmux: add stty command alias for resizing (serial) terminals

---
 home/common/tmux.nix | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/home/common/tmux.nix b/home/common/tmux.nix
index 141339e..d5b0687 100644
--- a/home/common/tmux.nix
+++ b/home/common/tmux.nix
@@ -31,6 +31,9 @@
       setw -g window-status-format ""
       setw -g window-status-current-format ""
       setw -g window-status-separator ""
+
+      set -s command-alias[1000] stty='run-shell "tmux send-keys \"stty cols #{pane_width} rows #{pane_height}\" Enter"'
+
       bind -n M-1 if-shell 'tmux select-window -t nvim' refresh-client 'new-window -S -n nvim nvim --listen $XDG_RUNTIME_DIR/nvim-persistent.sock'
       bind -n M-2 if-shell 'tmux select-window -t t1' refresh-client 'new-window -S -n t1'
       bind -n M-3 if-shell 'tmux select-window -t t2' refresh-client 'new-window -S -n t2'