1
0
Fork 0
mirror of https://github.com/LnL7/nix-darwin.git synced 2025-03-28 02:37:09 +00:00

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
This commit is contained in:
Eric Bailey 2017-12-29 17:00:09 -06:00 committed by Eric Bailey
parent f235d89c59
commit b6e692361e
No known key found for this signature in database
GPG key ID: 55BF5D49549F04AD

View file

@ -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}"