FFFF hg_prompt does not handle directories that contain "\n". · Issue #11348 · fish-shell/fish-shell · GitHub
[go: up one dir, main page]

Skip to content

hg_prompt does not handle directories that contain "\n".  #11348

@XiJet-Gary

Description

@XiJet-Gary

My Fish Shell version is 4.0.1
OS: Linux ga 6.13.8-zen1-1-zen #1 ZEN SMP PREEMPT_DYNAMIC Sun, 23 Mar 2025 17:17:17 +0000 x86_64 GNU/Linux
(Arch Linux)
echo $TERM: xterm-256color
(The bug will occur both in code-oss and konsole. )
The problem still persists after using the command sh -c 'env HOME=$(mktemp -d) XDG_CONFIG_HOME= XDG_DATA_DIRS= fish'.
Enter the following commands to reproduce the bug:

mkdir a\nb
cd a\nb

This will cause the path displayed in the command prompt to be abnormal, and the following error message will pop up every time a command is executed:

test: Expected a combining operator like '-a' at index 2
/tmp/tmp.AsVCpNwERk/a b != /
^
/usr/share/fish/functions/fish_print_hg_root.fish (line 13):
while test $dir != /
^
in function 'fish_print_hg_root'
called on line 1 of file /usr/share/fish/functions/fish_hg_prompt.fish
in command substitution
called on line 30 of file /usr/share/fish/functions/fish_hg_prompt.fish
in function 'fish_hg_prompt'
called on line 5 of file /usr/share/fish/functions/fish_vcs_prompt.fish
in function 'fish_vcs_prompt'
called on line 1 of file /usr/share/fish/functions/fish_prompt.fish
in command substitution
called on line 33 of file /usr/share/fish/functions/fish_prompt.fish
in function 'fish_prompt'
in command substitution

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething that's not working as intended

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      0