Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Prompt not visible in 3.1 if non-ascii character is used #6736

Closed
jorgelt opened this issue Mar 11, 2020 · 8 comments
Closed

Prompt not visible in 3.1 if non-ascii character is used #6736

jorgelt opened this issue Mar 11, 2020 · 8 comments
Milestone

Comments

@jorgelt
Copy link

jorgelt commented Mar 11, 2020

Fish 3.1.0 in Arch Linux using Konsole (but also reproducible in Xterm and Ctrl+Alt+f1/f6 virtual console) with $TERM = xterm-256color.

The prompt is not visible anymore just by changing the prompt to "Sorin" using fish_config. I can still type commands but the prompt is not visible. I observed that the problem happens as soon as I use a non-ascii character in fish_prompt. In the example visible in the screenshot I use "❯" from the Sorin prompt. Also, if I execute "fish_prompt" the expected prompt is printed:
image

I believe it is probably not related to fonts since:

  • The prompt is printed if I manually type fish_prompt
  • Spacefish was working fine with fish 3.0
  • Starship works fine in bash

How can I debug this? Any tip?

@faho
Copy link
Member

faho commented Mar 11, 2020

Please give the output of locale

@jorgelt
Copy link
Author

jorgelt commented Mar 11, 2020

locale
LANG=C
LC_CTYPE="C"
LC_NUMERIC="C"
LC_TIME="C"
LC_COLLATE="C"
LC_MONETARY="C"
LC_MESSAGES="C"
LC_PAPER="C"
LC_NAME="C"
LC_ADDRESS="C"
LC_TELEPHONE="C"
LC_MEASUREMENT="C"
LC_IDENTIFICATION="C"
LC_ALL=

@faho
Copy link
Member

faho commented Mar 11, 2020

That's your issue. Please set the locale to something that can handle unicode, like one of the ".UTF-8" locales.

See https://wiki.archlinux.org/index.php/Locale. Most likely you need to generate one, then configure it in /etc/locale.conf.


This is still not a great failure mode - what it's supposed to do is to replace the unknown characters with "?", which is also what happens in my prompt, but for some reason the sorin prompt's

function fish_prompt; echo -n (set_color red)''(set_color yellow)''(set_color green)''; end

doesn't.

@jorgelt
Copy link
Author

jorgelt commented Mar 11, 2020

Thank you @faho indeed that was the issue. Changing the locale to en_US.UTF-8 solved it.

Should I close the issue or do you prefer to keep it open to track the failure mode not changing the unknown characters with "?" ?

@faho
Copy link
Member

faho commented Mar 11, 2020

Let's keep it open, I'm bisecting.

@faho
Copy link
Member

faho commented Mar 11, 2020

Bisects to 5134949. Well, I say that. Unfortunately it had a crash bug with a C locale which was only fixed by 2b0b3d3, but cherry-picking that on top makes it not crash yet fail to output.

cc @ridiculousfish Mind taking a look? The issue is that

function fish_prompt; echo 😃; end

or other non-ascii chars causes no visible output with a C locale.

@faho
Copy link
Member

faho commented Mar 11, 2020

Okay, it's actually 2b0b3d3.

@faho
Copy link
Member

faho commented Mar 11, 2020

Fixed in master with 6237a24, 3.1.1 with 1a063fe.

(I forgot to include the magical "fixes" comment)

@faho faho closed this as completed Mar 11, 2020
@faho faho added this to the fish 3.1.1 milestone Mar 11, 2020
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jun 9, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants