159e378cbb
GitOrigin-RevId: c04d5652cfa9742b1d519688f65d1bbccea9eb7e
51 lines
1.2 KiB
Nix
51 lines
1.2 KiB
Nix
{ config, pkgs, lib, ... }:
|
|
let
|
|
|
|
vteInitSnippet = ''
|
|
# Show current working directory in VTE terminals window title.
|
|
# Supports both bash and zsh, requires interactive shell.
|
|
. ${pkgs.vte.override { gtkVersion = null; }}/etc/profile.d/vte.sh
|
|
'';
|
|
|
|
in
|
|
|
|
{
|
|
|
|
meta = {
|
|
maintainers = lib.teams.gnome.members;
|
|
};
|
|
|
|
options = {
|
|
|
|
programs.bash.vteIntegration = lib.mkOption {
|
|
default = false;
|
|
type = lib.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 = lib.mkOption {
|
|
default = false;
|
|
type = lib.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 = lib.mkMerge [
|
|
(lib.mkIf config.programs.bash.vteIntegration {
|
|
programs.bash.interactiveShellInit = lib.mkBefore vteInitSnippet;
|
|
})
|
|
|
|
(lib.mkIf config.programs.zsh.vteIntegration {
|
|
programs.zsh.interactiveShellInit = vteInitSnippet;
|
|
})
|
|
];
|
|
}
|