From 73046ec838ca90cbf7e1ea1b1ac89f5c44eec52d Mon Sep 17 00:00:00 2001 From: ridiculousfish Date: Tue, 9 Apr 2013 23:48:03 -0700 Subject: Stomp exit status of initialization scripts so that fish starts out with $status 0 https://github.com/fish-shell/fish-shell/issues/635 --- etc/config.fish | 4 ++-- fish.cpp | 3 +++ 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/etc/config.fish b/etc/config.fish index 2c4a2251..0683f40e 100644 --- a/etc/config.fish +++ b/etc/config.fish @@ -28,8 +28,8 @@ if status --is-login # 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 unicode_start end diff --git a/fish.cpp b/fish.cpp index 3d7c749e..36dbdb75 100644 --- a/fish.cpp +++ b/fish.cpp @@ -460,6 +460,9 @@ int main(int argc, char **argv) const io_chain_t empty_ios; 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 */ if (! cmds.empty()) { -- cgit v1.2.3