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

Alt-D prints a set_color error and garbled history #337

Closed
SanskritFritz opened this issue Oct 3, 2012 · 12 comments
Closed

Alt-D prints a set_color error and garbled history #337

SanskritFritz opened this issue Oct 3, 2012 · 12 comments
Labels
Milestone

Comments

@SanskritFritz
Copy link
Contributor

When I press alt-D I get this:

set_color: Expected an argument
<...snip long section about set_color usage>
-e /home/sans -e /home/sans/.config

@ridiculousfish
Copy link
Member

alt-D invokes dirh, which includes this:

set_color $fish_color_history_current
echo -n -e $current$separator
set_color normal

What value do you have set for $fish_color_history_current?

@SanskritFritz
Copy link
Contributor Author

Aha, it's empty, I remember deleting it.
echo $fish_color_history_current
gives empty return.
Ok, setting the variable makes it better, but the -e stays in the output.

@ridiculousfish
Copy link
Member

I've got no idea what that -e is doing there.

@SanskritFritz
Copy link
Contributor Author

That means, you don't have it in your system?

@ridiculousfish
Copy link
Member

I do have the -e, I don't know why.

@SanskritFritz
Copy link
Contributor Author

I experimented a little. dirh.fish contains the following: "echo -n -e $dirnext[$i]$separator", so I got suspicious.
When I issue "echo -n -e hello" from the command line, I get "-e hello" which is wrong, both bash and zsh correctly print only "hello" without a newline. "builtin echo -n -e hello" or "command echo -n -e hello" behave the same way, meanwhile "/usr/bin/echo -n -e hello" works correctly. Clearly the built-in "echo" does not recognise the "-e" switch. I didn't find any alias for echo in my system, "locate echo.fish" returns only the completions for echo.

@ridiculousfish
Copy link
Member

Looks like some echoes have this option:

-e: enable interpretation of the backslash-escaped characters listed below

@SanskritFritz
Copy link
Contributor Author

Exactly, that's why I think this is a bug in fish.

UPDATE: hmm, IIRC you use a Mac, hence echo behaves differently on your system. builtin echo does support -e in fish legacy I just tested it.

@ridiculousfish
Copy link
Member

Actually, the original fish had no builtin echo. Instead it used /bin/echo.
It seems like we ought to just implement -e.

@ridiculousfish
Copy link
Member

Commit 469743c makes set_color not complain when passed no arguments.

@ridiculousfish
Copy link
Member

echo -e implemented as 7ee0ce7

@SanskritFritz
Copy link
Contributor Author

Thank you, works like charm!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants