No description
Find a file
Adam Cozzette e9d1a54983 fix: Fish may hang in Linux virtual console
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>
2011-07-28 09:50:39 +08:00
doc_src minor changes on user doc 2011-02-20 02:58:11 +08:00
etc remove trialing spaces #2 2010-09-18 10:18:26 +08:00
po remove trialing spaces #2 2010-09-18 10:18:26 +08:00
share Change git-symbolic-ref to git symbolic-ref. 2011-06-19 14:14:40 -04:00
tests add test case for 364d3dbbf8 2010-11-24 00:35:56 +08:00
.gitignore update .gitignore 2010-10-05 21:14:43 +08:00
builtin.c builtin: count should not accept options, not even help 2010-11-26 19:00:18 +08:00
builtin.h remove trailing spaces 2010-09-18 09:51:16 +08:00
builtin_commandline.c silences some warnings outputted by gcc with -Wall and -Wextra 2010-10-08 08:43:57 +08:00
builtin_complete.c silences some warnings outputted by gcc with -Wall and -Wextra 2010-10-08 08:43:57 +08:00
builtin_jobs.c silences some warnings outputted by gcc with -Wall and -Wextra 2010-10-08 08:43:57 +08:00
builtin_set.c silences some warnings outputted by gcc with -Wall and -Wextra 2010-10-08 08:43:57 +08:00
builtin_ulimit.c silences some warnings outputted by gcc with -Wall and -Wextra 2010-10-08 08:43:57 +08:00
common.c remove trailing spaces 2010-09-18 09:51:16 +08:00
common.h remove trailing spaces 2010-09-18 09:51:16 +08:00
complete.c remove trailing spaces 2010-09-18 09:51:16 +08:00
complete.h remove trailing spaces 2010-09-18 09:51:16 +08:00
config.guess Update to latest config.sub and config.guess versions 2006-03-02 02:28:21 +10:00
config.sub Update to latest config.sub and config.guess versions 2006-03-02 02:28:21 +10:00
configure.ac configure xsel in configure phase 2010-09-18 14:31:18 +08:00
create_wajig_completions.py Add the file that generated the wajig completions to the tree. This should not be installed but it should be included with the tarball. The file was written by Reuben Thomas. 2006-11-04 00:26:45 +10:00
Doxyfile remove trialing spaces #2 2010-09-18 10:18:26 +08:00
Doxyfile.help.in remove trialing spaces #2 2010-09-18 10:18:26 +08:00
Doxyfile.user remove trialing spaces #2 2010-09-18 10:18:26 +08:00
env.c check allocated memory when setting SHLVL 2010-10-08 09:38:06 +08:00
env.h remove trailing spaces 2010-09-18 09:51:16 +08:00
env_universal.c remove trailing spaces 2010-09-18 09:51:16 +08:00
env_universal.h remove trailing spaces 2010-09-18 09:51:16 +08:00
env_universal_common.c remove trailing spaces 2010-09-18 09:51:16 +08:00
env_universal_common.h remove trailing spaces 2010-09-18 09:51:16 +08:00
event.c remove trailing spaces 2010-09-18 09:51:16 +08:00
event.h remove trailing spaces 2010-09-18 09:51:16 +08:00
exec.c exec: Don't format status returned directly from builtin function 2010-11-24 00:27:16 +08:00
exec.h remove trailing spaces 2010-09-18 09:51:16 +08:00
expand.c remove trailing spaces 2010-09-18 09:51:16 +08:00
expand.h remove trailing spaces 2010-09-18 09:51:16 +08:00
fallback.c remove trailing spaces 2010-09-18 09:51:16 +08:00
fallback.h remove trailing spaces 2010-09-18 09:51:16 +08:00
fish.c Modify getopt string to force posix compliance. I forgot why I 2010-11-05 09:29:10 -06:00
fish.spec.in remove trialing spaces #2 2010-09-18 10:18:26 +08:00
fish_indent.c fish_indent: indent "case" with the same level as "swith" 2010-12-02 23:42:48 +08:00
fish_pager.c remove trailing spaces 2010-09-18 09:51:16 +08:00
fish_tests.c remove trailing spaces 2010-09-18 09:51:16 +08:00
fishd.c remove trailing spaces 2010-09-18 09:51:16 +08:00
function.c Merge remote branch 'origin/otherchirps-dev' 2010-09-19 14:12:30 +08:00
function.h Merge remote branch 'origin/otherchirps-dev' 2010-09-19 14:12:30 +08:00
halloc.c remove trailing spaces 2010-09-18 09:51:16 +08:00
halloc.h remove trailing spaces 2010-09-18 09:51:16 +08:00
halloc_util.c remove trailing spaces 2010-09-18 09:51:16 +08:00
halloc_util.h Use halloc in a few more places, including the highlight code 2006-06-13 00:12:33 +10:00
highlight.c remove trailing spaces 2010-09-18 09:51:16 +08:00
highlight.h remove trailing spaces 2010-09-18 09:51:16 +08:00
history.c remove trailing spaces 2010-09-18 09:51:16 +08:00
history.h remove trailing spaces 2010-09-18 09:51:16 +08:00
input.c event_fire( 0 ); => event_fire( NULL ); 2010-09-18 21:30:02 +08:00
input.h remove trailing spaces 2010-09-18 09:51:16 +08:00
input_common.c remove trailing spaces 2010-09-18 09:51:16 +08:00
input_common.h remove trailing spaces 2010-09-18 09:51:16 +08:00
INSTALL remove trialing spaces #2 2010-09-18 10:18:26 +08:00
install-sh remove trialing spaces #2 2010-09-18 10:18:26 +08:00
intern.c remove trailing spaces 2010-09-18 09:51:16 +08:00
intern.h Huge API documentation cleanup 2005-10-25 01:26:25 +10:00
io.c remove trailing spaces 2010-09-18 09:51:16 +08:00
io.h remove trailing spaces 2010-09-18 09:51:16 +08:00
key_reader.c remove trailing spaces 2010-09-18 09:51:16 +08:00
kill.c Merged changes from codemonkey and grissiom branches 2010-11-12 02:07:14 +11:00
kill.h Fix the kill-line, backward-kill-line and kill-whole-line commands to work correctly with multiline editing 2006-10-12 23:27:32 +10:00
make_completions.py remove trialing spaces #2 2010-09-18 10:18:26 +08:00
make_vcs_completions.fish remove trialing spaces #2 2010-09-18 10:18:26 +08:00
Makefile.in Makefile: test for xsel directory before trying to clean it. 2010-12-02 01:12:34 +08:00
mimedb.c mimedb: Search all the defaults.list files rather than just the first. 2010-12-02 23:55:45 +08:00
mimedb.h Add header guards to the header files. 2005-10-05 01:11:39 +10:00
output.c remove trailing spaces 2010-09-18 09:51:16 +08:00
output.h remove trailing spaces 2010-09-18 09:51:16 +08:00
parse_util.c remove trailing spaces 2010-09-18 09:51:16 +08:00
parse_util.h remove trailing spaces 2010-09-18 09:51:16 +08:00
parser.c break long lines 2010-11-22 08:42:57 +08:00
parser.h remove trailing spaces 2010-09-18 09:51:16 +08:00
parser_keywords.c remove trailing spaces 2010-09-18 09:51:16 +08:00
parser_keywords.h remove trailing spaces 2010-09-18 09:51:16 +08:00
path.c remove trailing spaces 2010-09-18 09:51:16 +08:00
path.h remove trailing spaces 2010-09-18 09:51:16 +08:00
print_help.c remove trailing spaces 2010-09-18 09:51:16 +08:00
print_help.h remove trailing spaces 2010-09-18 09:51:16 +08:00
proc.c fix: Fish may hang in Linux virtual console 2011-07-28 09:50:39 +08:00
proc.h remove trailing spaces 2010-09-18 09:51:16 +08:00
reader.c fix null reference when erase TERM env 2010-10-06 20:58:13 +08:00
reader.h remove trailing spaces 2010-09-18 09:51:16 +08:00
README Initial revision 2005-09-20 23:26:39 +10:00
sanity.c remove trailing spaces 2010-09-18 09:51:16 +08:00
sanity.h remove trailing spaces 2010-09-18 09:51:16 +08:00
screen.c only count the last line of promt when caculate prompt width 2010-09-24 19:01:13 +08:00
screen.h remove trailing spaces 2010-09-18 09:51:16 +08:00
seq.in Merged changes from codemonkey and grissiom branches 2010-11-12 02:07:14 +11:00
set_color.c remove trailing spaces 2010-09-18 09:51:16 +08:00
signal.c silences some warnings outputted by gcc with -Wall and -Wextra 2010-10-08 08:43:57 +08:00
signal.h Make sure signals aren't blocked while autoloading, also add a few consistency checks to see that signals aren't blocked in critical places 2006-10-30 07:09:11 +10:00
tokenizer.c remove trailing spaces 2010-09-18 09:51:16 +08:00
tokenizer.h remove trailing spaces 2010-09-18 09:51:16 +08:00
user_doc.head.html remove trialing spaces #2 2010-09-18 10:18:26 +08:00
util.c remove trailing spaces 2010-09-18 09:51:16 +08:00
util.h remove trailing spaces 2010-09-18 09:51:16 +08:00
wgetopt.c remove trailing spaces 2010-09-18 09:51:16 +08:00
wgetopt.h remove trailing spaces 2010-09-18 09:51:16 +08:00
wildcard.c remove trailing spaces 2010-09-18 09:51:16 +08:00
wildcard.h remove trailing spaces 2010-09-18 09:51:16 +08:00
wutil.c remove trailing spaces 2010-09-18 09:51:16 +08:00
wutil.h remove trailing spaces 2010-09-18 09:51:16 +08:00
xdgmime.c remove trailing spaces 2010-09-18 09:51:16 +08:00
xdgmime.h remove trailing spaces 2010-09-18 09:51:16 +08:00
xdgmimealias.c remove trailing spaces 2010-09-18 09:51:16 +08:00
xdgmimealias.h Initial revision 2005-09-20 23:26:39 +10:00
xdgmimeglob.c remove trailing spaces 2010-09-18 09:51:16 +08:00
xdgmimeglob.h remove trailing spaces 2010-09-18 09:51:16 +08:00
xdgmimeint.c Use char instead of unsigned char in xdgmime files. Avoids a few warnings. 2005-12-12 08:28:33 +10:00
xdgmimeint.h Initial revision 2005-09-20 23:26:39 +10:00
xdgmimemagic.c Use char instead of unsigned char in xdgmime files. Avoids a few warnings. 2005-12-12 08:28:33 +10:00
xdgmimemagic.h Initial revision 2005-09-20 23:26:39 +10:00
xdgmimeparent.c remove trailing spaces 2010-09-18 09:51:16 +08:00
xdgmimeparent.h Initial revision 2005-09-20 23:26:39 +10:00
xsel-1.2.0.tar.gz upgrade xsel to 1.2.0 2010-09-18 10:14:14 +08:00

How to find documentation for fish
==================================

The fish documentation is distributed in an intermediate format. To
view it, you have to type:

  % make user_doc

Which will create the directory user_doc, containing html
documentation for fish. If you build and install fish, the
documentation will be available through the 'help' builtin.

After installation, you can start fish by typing fish in the
terminal. After fish has started, try using the help command for more
information.