fork/home-manager
git clone https://git.julia.blue/fork/home-manager
bb567e20
master
1{ config , lib , pkgs , ...} : 2 3with lib ; 4 5{ 6meta . maintainers = [ maintainers . rycee ]; 7 8options . programs = let 9description = '' 10Whether to enable integration with terminals using the VTE 11library. This will let the terminal track the current working 12directory. 13'' ; 14in { 15bash . enableVteIntegration = mkEnableOption "" // { inherit description ; }; 16 17zsh . enableVteIntegration = mkEnableOption "" // { inherit description ; }; 18}; 19 20config = mkMerge [ 21( mkIf config . programs . bash . enableVteIntegration { 22# Unfortunately we have to do a little dance here to fix two 23# problems with the upstream vte.sh file: 24# 25# - It does `PROMPT_COMMAND="__vte_prompt_command"` which 26# clobbers any previously assigned prompt command. 27# 28# - Its `__vte_prompt_command` function runs commands that will 29# overwrite the exit status of the command the user ran. 30programs . bash . initExtra = '' 31__HM_PROMPT_COMMAND="''${PROMPT_COMMAND:+''${PROMPT_COMMAND%;};}__hm_vte_prompt_command" 32. ${ pkgs . vte } /etc/profile.d/vte.sh 33if [[ $(type -t __vte_prompt_command) = function ]]; then 34__hm_vte_prompt_command() { 35local old_exit_status=$? 36__vte_prompt_command 37return $old_exit_status 38} 39PROMPT_COMMAND="$__HM_PROMPT_COMMAND" 40fi 41unset __HM_PROMPT_COMMAND 42'' ; 43}) 44 45( mkIf config . programs . zsh . enableVteIntegration { 46programs . zsh . initExtra = '' 47. ${ pkgs . vte } /etc/profile.d/vte.sh 48'' ; 49}) 50]; 51}