Stomp exit status of initialization scripts so that fish starts out with $status 0

https://github.com/fish-shell/fish-shell/issues/635
This commit is contained in:
ridiculousfish 2013-04-09 23:48:03 -07:00
parent e1734468f5
commit 73046ec838
2 changed files with 5 additions and 2 deletions

View File

@ -28,8 +28,8 @@ if status --is-login
# Put linux consoles in unicode mode. # Put linux consoles in unicode mode.
# #
if expr "$LANG" : ".*\.[Uu][Tt][Ff].*" >/dev/null if test "$TERM" = linux
if test "$TERM" = linux if expr "$LANG" : ".*\.[Uu][Tt][Ff].*" >/dev/null
if which unicode_start >/dev/null if which unicode_start >/dev/null
unicode_start unicode_start
end end

View File

@ -460,6 +460,9 @@ int main(int argc, char **argv)
const io_chain_t empty_ios; const io_chain_t empty_ios;
if (read_init(paths)) if (read_init(paths))
{ {
/* Stop the exit status of any initialization commands (#635) */
proc_set_last_status(STATUS_BUILTIN_OK);
/* Run the commands specified as arguments, if any */ /* Run the commands specified as arguments, if any */
if (! cmds.empty()) if (! cmds.empty())
{ {