This module correctly includes the vte.sh script required for vte terminals like gnome-terminal to show the CWD in the window title and preserved across instances. This is achieved with the options: * programs.bash.vteIntegration * programs.zsh.vteIntegration as it's best to keep this configuration unguarded by gnome3.enable to support other vte terminals (such as elementary-terminal). Note the distinction between Zsh and Bash doesn't include a different script, as this script only supports those two shells.wip/yesman
parent
9125f51b70
commit
79dd78b911
@ -0,0 +1,52 @@ |
||||
# VTE |
||||
|
||||
{ config, pkgs, lib, ... }: |
||||
|
||||
with lib; |
||||
|
||||
let |
||||
|
||||
vteInitSnippet = '' |
||||
# Show current working directory in VTE terminals window title. |
||||
# Supports both bash and zsh, requires interactive shell. |
||||
. ${pkgs.vte}/etc/profile.d/vte.sh |
||||
''; |
||||
|
||||
in |
||||
|
||||
{ |
||||
|
||||
options = { |
||||
|
||||
programs.bash.vteIntegration = mkOption { |
||||
default = false; |
||||
type = types.bool; |
||||
description = '' |
||||
Whether to enable Bash integration for VTE terminals. |
||||
This allows it to preserve the current directory of the shell |
||||
across terminals. |
||||
''; |
||||
}; |
||||
|
||||
programs.zsh.vteIntegration = mkOption { |
||||
default = false; |
||||
type = types.bool; |
||||
description = '' |
||||
Whether to enable Zsh integration for VTE terminals. |
||||
This allows it to preserve the current directory of the shell |
||||
across terminals. |
||||
''; |
||||
}; |
||||
|
||||
}; |
||||
|
||||
config = mkMerge [ |
||||
(mkIf config.programs.bash.vteIntegration { |
||||
programs.bash.interactiveShellInit = vteInitSnippet; |
||||
}) |
||||
|
||||
(mkIf config.programs.zsh.vteIntegration { |
||||
programs.zsh.interactiveShellInit = vteInitSnippet; |
||||
}) |
||||
]; |
||||
} |
Loading…
Reference in new issue