I find that if I have a config.fish consisting of the following two
lines
status --job-control full
. empty.fish
where empty.fish is just an empty file in ~/.config/fish, Fish will
hang when I attempt to log in on a virtual console (e.g. tty1). If I run
Fish within X11 or with either of those lines commented out,
everything's fine. I think the second line can be any command that cause
Fish to perform a fork().
The fix is pretty simple and just involves replacing getpid() with
getpgrp() in terminal_return_from_job in proc.c. See below for the
detailed explanation. I'm certainly no expert so I would appreciate it
if anyone else can confirm that my fix looks ok.
Here's what causes the bug as far as I can tell:
1. When I login on a virtual console, /bin/login calls Fish. When Fish
begins executing its process group and the process group controlling the
terminal are both the pid of the /bin/login process.
2. The ". empty.fish" line causes Fish to fork a new process. The new
process creates a new process group and takes control of the terminal
under the name of that process group.
3. When the child process finishes, the parent prcoess attempts to take
back control of the terminal by setting its controlling process group id
to be its pid.
4. Now there is a mismatch between the process group id of the Fish
shell (= the pid of the /bin/login process) and the process group id
controlling the terminal (= the pid of the Fish shell).
reader_interactive_init detects the mismatch and it thinks that it
doesn't have control of the terminal, so it hangs as it waits for
control.
My fix just solves the problem in step 3 by having the parent process
correctly reassign control of the terminal to its process group.
Signed-off-by: Grissiom <chaos.proton@gmail.com>
On my system at least (fedora 15), git-symbolic-ref is an invalid
command. Not sure if it's a BIC change from git itself, a distribution
thing, or a mistake on my end. Either way, no harm in using the
extended version. Now I get git branch status (yay).
The first defaults.list file found should not override all the other ones,
it just needs to be searched first.
E.g. For me (cat ~/.local/share/applications/defaults.list) returns
[Default Applications]
text/html=chromium-browser.desktop
So this should be used for text/html mimetypes, but the other defaults.list
files should be searched for other mimetypes.
I had to refactor get_filename so that it can return all the filenames, so
I changed it to append_filenames that appends all the filenames to a list
and provided a wrapper function called get_filename.
On Gentoo the eix program is MUCH faster than emerge for listing package
names. I've left the emerge code in as a 2nd choice because not every
Gentoo system has eix installed (although they should). Also, the
emerge code didn't seem to produce any output on my system.
Signed-off-by: Grissiom <chaos.proton@gmail.com>
get_filename tried to work around this with hardcoded strings that end with
a '/', but would fail to work properly for environment variables
XDG_DATA_HOME or XDG_DATA_DIRS that don't do the same.
Renamed references to the previous command name of save_function to
funcsave, and returned an error after printing the help text when no
arguments are specified.
It is documented this way, but the common builtin_run function was
checking for -h or --help before even calling the builtin_count. Without
this functions like funced can't use count to check the number of
arguments before checking for -h or --help.
Signed-off-by: Grissiom <chaos.proton@gmail.com>