mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-11-16 23:03:40 +01:00
53 lines
1.1 KiB
Nix
53 lines
1.1 KiB
Nix
|
# 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;
|
||
|
})
|
||
|
];
|
||
|
}
|