From b6e692361e033576a81084d776728af8320ae580 Mon Sep 17 00:00:00 2001 From: Eric Bailey Date: Fri, 29 Dec 2017 17:00:09 -0600 Subject: [PATCH] tmux: play nice with iTerm2 That is, don't use reattach-to-user-namespace. iTerm2 provides an option to allow applications in the terminal to access the clipboard, as well as deeper shell integration utilities, which obviate the need for reattach-to-user-namespace. What's more, iTerm2's tmux integration doesn't work with it, nor when aggressive-resize is on. See also: - https://iterm2.com/documentation-preferences.html - https://iterm2.com/documentation-utilities.html - https://iterm2.com/documentation-tmux-integration.html - https://github.com/tmux-plugins/tmux-sensible/issues/24 --- modules/programs/tmux.nix | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/modules/programs/tmux.nix b/modules/programs/tmux.nix index 9ad9d637..906a0d7e 100644 --- a/modules/programs/tmux.nix +++ b/modules/programs/tmux.nix @@ -73,6 +73,13 @@ in description = "Enable vim style keybindings for copy mode, and navigation of tmux panes."; }; + programs.tmux.iTerm2 = mkOption { + type = types.bool; + default = false; + example = true; + description = "Cater to iTerm2 and its tmux integration, as appropriate."; + }; + programs.tmux.tmuxOptions = mkOption { internal = true; type = types.attrsOf (types.submodule text); @@ -100,7 +107,7 @@ in source-file -q /etc/tmux.conf.local ''; - programs.tmux.tmuxOptions.login-shell.text = if stdenv.isDarwin then '' + programs.tmux.tmuxOptions.login-shell.text = if stdenv.isDarwin && !cfg.iTerm2 then '' set -g default-command "${pkgs.reattach-to-user-namespace}/bin/reattach-to-user-namespace ${config.environment.loginShell}" '' else '' set -g default-command "${config.environment.loginShell}"