-
-
Save timbertson/975901f650b267fa3178 to your computer and use it in GitHub Desktop.
fish issue #125 patch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/fish.cpp b/fish.cpp | |
index 24424e5..df9b002 100644 | |
--- a/fish.cpp | |
+++ b/fish.cpp | |
@@ -71,10 +71,15 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. | |
*/ | |
static int read_init() | |
{ | |
- parser_t &parser = parser_t::principal_parser(); | |
+ parser_t &parser = parser_t::principal_parser(); | |
+ | |
+ env_var_t datadir = env_get_string(L"__fish_datadir"); | |
+ if(datadir.missing()) datadir = env_var_t(DATADIR); | |
+ env_var_t sysconfdir = env_get_string(L"__fish_sysconfdir"); | |
+ if(sysconfdir.missing()) sysconfdir = env_var_t(SYSCONFDIR); | |
- parser.eval( L"builtin . " DATADIR "/fish/config.fish 2>/dev/null", 0, TOP ); | |
- parser.eval( L"builtin . " SYSCONFDIR L"/fish/config.fish 2>/dev/null", 0, TOP ); | |
+ parser.eval( format_string(L"builtin . %ls/fish/config.fish 2>/dev/null", datadir.c_str()), 0, TOP ); | |
+ parser.eval( format_string(L"builtin . %ls/fish/config.fish 2>/dev/null", sysconfdir.c_str()), 0, TOP ); | |
/* | |
We need to get the configuration directory before we can source the user configuration file |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
set -ex | |
here="$(readlink -f "$(dirname "$(dirname "$0")")")" | |
export PATH="$here/bin:$PATH" | |
export __fish_datadir="$here/share/fish" | |
export __fish_help_dir="$here/doc/fish" | |
export __fish_sysconfdir="$here/etc/fish" | |
export fish_complete_path="$HOME/.config/fish/completions:$here/etc/fish/completions:$here/share/fish/completions" | |
export fish_function_path="$HOME/.config/fish/functions:$here/etc/fish/functions:$here/share/fish/functions" | |
exec "$here/bin/fish" "$@" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment