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

Fish does not work in a TTY session. #2070

Closed
ghost opened this issue May 18, 2015 · 15 comments
Closed

Fish does not work in a TTY session. #2070

ghost opened this issue May 18, 2015 · 15 comments
Milestone

Comments

@ghost
Copy link

ghost commented May 18, 2015

In ubuntu if you set fish as your default shell and press ctrl+alt+f1 log in and use fish, the history colors etc are all broken.

@hai-ld
Copy link

hai-ld commented May 19, 2015

It works for me (fish 2.1.1, Ubuntu 14.04.2). Could you elaborate the issue?

@ghost
Copy link
Author

ghost commented May 19, 2015

Mabie it was the colors I was using the current version works fine It just prints weird characters before the prompt.

@zanchey
Copy link
Member

zanchey commented May 21, 2015

My guess is that you are printing UTF-8 to a non-capable terminal.

Can you confirm the version you are running, the version of Ubuntu you are using and the value of echo $TERM when you are logged in on the console?

@ghost
Copy link
Author

ghost commented May 22, 2015

echo $TERM outputs "linux", echo $FISH_VERSION outputs "2.1.1", and cat /etc/issue outputs "Ubuntu 15.04"

@zanchey
Copy link
Member

zanchey commented May 26, 2015

I also meant to ask for the output of locale.

@zanchey
Copy link
Member

zanchey commented May 26, 2015

Basically, I'm wondering if you're seeing this - http://superuser.com/questions/556993/how-to-display-unicode-in-a-linux-virtual-terminal

@ghost
Copy link
Author

ghost commented May 28, 2015

I'm sorry I switched linuxes I'm now using Sabayon and have not checked for the same problems but I believe my locale was probably en_UTF8.

@pickfire
Copy link
Contributor

I have this problem too, but after I switched to the default theme, it works fine. I guess it is the problem of unicode character support in framebuffer, since it doesn't work with some arrows.

@zanchey
Copy link
Member

zanchey commented Jun 3, 2015

I don't think there's much we can do about this. AFAICT, the text-mode console only supports 16 colours and 512 glyphs, and even with fbdev supporting more colors the console fonts don't implement all of Unicode anyway. KMSCON is probably the way to go if you need arrows or many fancy colors on your terminal.

@pickfire
Copy link
Contributor

pickfire commented Jun 3, 2015

What about disabling arrows in framebuffer by changing the fish theme?

if test $SSH_TTY
    printf '% '
    return 0
end

@Lucretiel
Copy link
Contributor

Wouldn't isatty be more idomatic?

@pickfire
Copy link
Contributor

Sorry I didn't meant to post that here. What I mean is:

# If login shell, don't do anything
if status --is-login; and function fish_prompt; echo -n '% '; end; end
_Note_: I uses echo because printf doesn't work

@faho
Copy link
Member

faho commented Aug 17, 2015

Note: I uses echo because printf doesn't work

printf needs two "%"'s to print a literal "%", i.e:

if $TERM = "linux"; function fish_prompt; printf '%%'; end; end

(the and is unnecessary since "if" has not only a condition but also a body, and the "$TERM = linux" is the more accurate check - an xterm can also run a login shell)

Really, I don't think this is going to improve much - the in-kernel VT sucks, which is why things like "kmscon" and the spun-off "systemd-consoled" exist.

What we can do is add a fallback prompt to all sample prompts that kicks in when "$TERM = linux" like I did above (note: this should be in the fish_prompt function so it switches without needing to go through fish_config again), and we can also add fallback-colors since VTs aren't going to support 256 colors.

Or we can recommend people use a userspace-vt (like kmscon) and actually have a nice experience.

@faho
Copy link
Member

faho commented Aug 17, 2015

Since I'm not quite sure GH notifies for references, I'm gonna say it here again:

I'm okay with #2311 - I've written it after all. If any of you isn't, please speak up and we'll try to find an alternative solution.

@faho faho added this to the next-2.x milestone Aug 30, 2015
@faho
Copy link
Member

faho commented Aug 30, 2015

Fixed by f71e877.

@faho faho closed this as completed Aug 30, 2015
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jun 1, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants