-
Notifications
You must be signed in to change notification settings - Fork 1.9k
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
"set_color: Expected an argument" appearing each time Fish loads #1335
Comments
It might be worth checking the output of For reference, mine is:
|
See also #337. |
Alright, so this seems to happen arbitrarily on some restarts, on the ones where it works, my set | grep fish_color seems to be standard, but otherwise, when it's not working, it's like this - andrew@haru ~> set | grep fish_color I've seen that thread above, and I've done some googling, but yeah, I can't really find any apparent fix. |
Started getting this message a couple of weeks ago. I'm running fish version 2.1.0 on Arch Linux. EDIT: It got sorted when I re-ran fish_config and rechose my prompt theme. |
Thanks for the command - I'm currently looking into some easy way to get the defaults back... |
Same here, on archlinux. I backup my fish_prompt, re-ran fish_config and choose anything, then restore my fish_prompt, it got fixed. I wonder why. |
I don't think this really fix anything, it just ignores the potential bug. The problem is why the variable |
osx 10.9 + ohh-my-fish $ brew info fish |
That's because sometimes fishd.MACHINE_ID will lose some contents. I backed up my fishd.cjprods as fishd.cjprods.bak, then wait this bug to appear. $ diff fishd.cjprods.bak fishd.cjprods
5d4
< SET __prompt_initialized_2:\x1d
14d12
< SET fish_color_host:\x2do\x1ecyan
22,23d19
< SET fish_color_status:red
< SET fish_color_user:\x2do\x1egreen So, you see that universal variables are all lost. |
Note (as the one who originally opened the issue) - mine has been completely fixed at this point, probably from one of the latest updates. Version 2.1.0-3 |
This happened to me after using OSX' Migration Assistant to move my user to new Mac. |
Fixed by re-running fish_config and choosing a prompt. |
Is there anyway to fix this without fish_config? I'm thinking about headless machines here |
It looks like set_color doesn't complain now, so this ought to no longer reproduce on ToT. We can leave this open to track actually repairing cases of unset colors. |
There is a workaround (a.k.a. dirty hack). When everything works as expected, open your
copy and paste them into
i.e. replace
i.e. replace So then, the universal variables will be set every time you launch fish.
In this way, it will only set those universal variables when they got lost together with |
|
I am having this issue with fish Re-running Opening
suppresses the error message, but probably some color definition will stay broken. Of course, choosing a prompt that does not have a similar code as this one will not cause the error message to show up, such as the |
What was the exact error you got? It looks like you probably need to set Peter
|
@pwr22 the exact error is:
Yes, that was the case, my fish_color_cwd was unset and after setting it the problem was solved. The thing is, I hadn't messed with my fish config in months and I have no idea why this happened. |
Having the same issue.
It happened for me when I did a clone from one Macbook to another, though that most likely is just coincidence. EDIT: As @bobef mentioned, this can be fixed be rerunning |
Same issue for me. It keeps reoccuring every other reboot or so. For no reason obvious to me fish_color_user and fish_color_host don't get set anymore and I have to reselect the 'Classic + Git' prompt to fix it. |
My suspicion is that your MAC address or other system identifier is changing, leading |
No they do not persist (I did 'set -e -U fish_greeting' and now it is set to the default value again). MAC address doesn't change on reboot. This is just a normal laptop with wifi and ethernet. What other mechanisms does fish use as system identifier? |
Same problem here. My config is fish |
Could you post the contents of |
$ ls -l .config/fish
total 564
-rw-r--r-- 1 mirco mirco 551972 Mar 16 00:02 fish_history
-rw-r--r-- 1 mirco mirco 18178 Mar 14 20:36 fish_read_history
-rw------- 1 mirco mirco 1157 Mar 16 00:01 fishd.frangipani
drwx------ 1 mirco mirco 288 Mar 14 20:31 functions where frangipani is my hostname By the way, why don't you use the content of /etc/machine-id if it exists (it does on most modern linux distributions)? It was created exactly for the purpose of uniquely identifying a machine and is stable for the lifetime of the installation unless manually changed and independent from hardware changes. |
Never heard of that before but I'm +1 for that too |
OK, it doesn't look like your hostname is changing, so that's that idea out. The reason fish doesn't use the machine-id, I suspect, is that it's relatively new. It would be good to use that on systems where it's available, although the migration path might be a bit interesting. Has anyone been able to reproduce this with a recent HEAD/master build? |
I used to have this issue back on the very old release in the ubuntu repos. Nothing like this since later versions though and for me the fishd files were all based on my MAC last I checked |
Here's how I just fixed it (when these values somehow disappeared from my fishd.hostname):
|
I've installed a git build now for a couple of months and the issue hasn't come up since, so it seems to be resolved in the next release. The release it occured on was 2.1.2. |
I think it would be a good idea to have a |
I have the same issue, after unexpected restart when something is going on in a console under fish I have set_color: Expected an argument and I need to manually chose prompt again in |
@AndrewHynes I'd like to propose closing this issue and continuing the discussion in issue #1912. Normally I would propose the inverse (closing the newer issue as a duplicate of the older one) but in this case I think the newer issue more clearly captures the core problem. |
Closing as duplicate. |
For the record with new version of fish shell the issue no longer happens on my machines. |
Hi, I've used Fish on my system since I installed it, but for some reason I keep getting an error message when Fish loads (via tty or from a terminal emulator within X).
"set_color: Expected an argument"
Appears, and the colours are different from what they used to be - e.g. the completions are white, rather than green, now.
I haven't changed anything in particular, and it was working last time my laptop was on, though the time before that, I updated Fish to the latest version available on my system, 2.1.
The version is the latest -
andrew@haru ~> fish --version
fish, version 2.1.0
You can see my config.fish here - I do not attempt to use set_color, and it hasn't been changed since when it /was/ working.
https://github.com/AndrewHynes/dotfiles/blob/master/config.fish
I run Arch Linux.
Thanks.
The text was updated successfully, but these errors were encountered: