-
-
Notifications
You must be signed in to change notification settings - Fork 2.2k
Closed
Labels
bugSomething that's not working as intendedSomething that's not working as intended
Milestone
Description
The behavior is as follows (at current master):
<host> ~/l/k/f/build (master)> set -e fish_prompt_pwd_full_dirs
<host> ~/l/k/f/build (master)> set -S fish_prompt_pwd_full_dirs
<host> ~/l/k/f/build (master)> set -U fish_prompt_pwd_full_dirs 2
<host> ~/l/k/fish-shell/build (master)> set -S fish_prompt_pwd_full_dirs
$fish_prompt_pwd_full_dirs: set in universal scope, unexported, with 1 elements
$fish_prompt_pwd_full_dirs[1]: |1|
<host> ~/l/k/f/build (master)> set -U fish_prompt_pwd_full_dirs 2; set -S fish_prompt_pwd_full_dirs
$fish_prompt_pwd_full_dirs: set in universal scope, unexported, with 1 elements
$fish_prompt_pwd_full_dirs[1]: |2|
<host> ~/l/k/fish-shell/build (master)>
<host> ~/l/k/f/build (master)>What's going on is that prompt_pwd incorrectly sets the global variable instead of the local one when using flags:
fish-shell/share/functions/prompt_pwd.fish
Lines 14 to 25 in deec78c
| set -ql _flag_d | |
| and set -l fish_prompt_pwd_dir_length $_flag_d | |
| set -q fish_prompt_pwd_dir_length | |
| or set -l fish_prompt_pwd_dir_length 1 | |
| set -l fulldirs 0 | |
| set -ql _flag_D | |
| and set fish_prompt_pwd_full_dirs $_flag_D | |
| set -q fish_prompt_pwd_full_dirs | |
| or set -l fish_prompt_pwd_full_dirs 1 |
See lines 15 and 22. The fix would be to set the local instead:
- and set fish_prompt_pwd_full_dirs $_flag_D
+ and set -l fish_prompt_pwd_full_dirs $_flag_DSidenote - the variable is changed every time a prompt appears, because prompt_pwd is called in fish_title:
| echo -- $ssh (string sub -l 20 -- $argv[1]) (prompt_pwd -d 1 -D 1) |
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
bugSomething that's not working as intendedSomething that's not working as intended