daily pastebin goal
62%
SHARE
TWEET

Untitled

a guest Feb 17th, 2019 56 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. contains: Unknown option '-gx'
  2. /usr/local/Cellar/fish/3.0.1/share/fish/config.fish (line 426):
  3.             if not contains $entry $result
  4.                ^
  5. in function '__fish_macos_set_env'
  6.         called on line 228 of file /usr/local/Cellar/fish/3.0.1/share/fish/config.fish
  7.         with parameter list 'PATH /etc/paths /etc/paths.d'
  8.  
  9. from sourcing file /usr/local/Cellar/fish/3.0.1/share/fish/config.fish
  10.         called during startup
  11.  
  12.  
  13.        contains - test if a word is present in a list
  14.  
  15.    Synopsis
  16.        contains [OPTIONS] KEY [VALUES...]
  17.  
  18. contains: Type 'help contains' for related documentation
  19.  
  20. contains: Unknown option '-e'
  21. /usr/local/Cellar/fish/3.0.1/share/fish/config.fish (line 426):
  22.             if not contains $entry $result
  23.                ^
  24. in function '__fish_macos_set_env'
  25.         called on line 228 of file /usr/local/Cellar/fish/3.0.1/share/fish/config.fish
  26.         with parameter list 'PATH /etc/paths /etc/paths.d'
  27.  
  28. from sourcing file /usr/local/Cellar/fish/3.0.1/share/fish/config.fish
  29.         called during startup
  30.  
  31.  
  32.        contains - test if a word is present in a list
  33.  
  34.    Synopsis
  35.        contains [OPTIONS] KEY [VALUES...]
  36.  
  37. contains: Type 'help contains' for related documentation
  38.    
  39. # Main file for fish command completions. This file contains various
  40. # common helper functions for the command completions. All actual
  41. # completions are located in the completions subdirectory.
  42. #
  43. # Set default field separators
  44. #
  45. set -g IFS n t
  46. set -qg __fish_added_user_paths
  47. or set -g __fish_added_user_paths
  48.  
  49. #
  50. # Create the default command_not_found handler
  51. #
  52. function __fish_default_command_not_found_handler
  53.     printf "fish: Unknown command %sn" (string escape -- $argv[1]) >&2
  54. end
  55.  
  56. if status --is-interactive
  57.     # The user has seemingly explicitly launched an old fish with too-new scripts installed.
  58.     if not contains -- "string" (builtin -n)
  59.         set -g __is_launched_without_string 1
  60.         # XXX nostring - fix old fish binaries with no `string' builtin.
  61.         # When executed on fish 2.2.0, the `else' block after this would
  62.         # force on 24-bit mode due to changes to in test behavior.
  63.         # These "XXX nostring" hacks were added for 2.3.1
  64.         set_color --bold
  65.         echo "You appear to be trying to launch an old fish binary with newer scripts "
  66.         echo "installed into" (set_color --underline)"$__fish_data_dir"
  67.         set_color normal
  68.         echo -e "nThis is an unsupported configuration.n"
  69.         set_color yellow
  70.         echo "You may need to uninstall and reinstall fish!"
  71.         set_color normal
  72.         # Remove this code when we've made it safer to upgrade fish.
  73.     else
  74.         # Enable truecolor/24-bit support for select terminals
  75.         # Ignore Screen and emacs' ansi-term as they swallow the sequences, rendering the text white.
  76.         if not set -q STY
  77.             and not string match -q -- 'eterm*' $TERM
  78.             and begin
  79.                 set -q KONSOLE_PROFILE_NAME # KDE's konsole
  80.                 or string match -q -- "*:*" $ITERM_SESSION_ID # Supporting versions of iTerm2 will include a colon here
  81.                 or string match -q -- "st-*" $TERM # suckless' st
  82.                 or test -n "$VTE_VERSION" -a "$VTE_VERSION" -ge 3600 # Should be all gtk3-vte-based terms after version 3.6.0.0
  83.                 or test "$COLORTERM" = truecolor -o "$COLORTERM" = 24bit # slang expects this
  84.             end
  85.             # Only set it if it isn't to allow override by setting to 0
  86.             set -q fish_term24bit
  87.             or set -g fish_term24bit 1
  88.         end
  89.     end
  90. else
  91.     # Hook up the default as the principal command_not_found handler
  92.     # in case we are not interactive
  93.     function __fish_command_not_found_handler --on-event fish_command_not_found
  94.         __fish_default_command_not_found_handler $argv
  95.     end
  96. end
  97.  
  98. #
  99. # Set default search paths for completions and shellscript functions
  100. # unless they already exist
  101. #
  102.  
  103. set -g __fish_config_dir ~/.config/fish
  104.  
  105. if set -q XDG_CONFIG_HOME
  106.     set __fish_config_dir $XDG_CONFIG_HOME/fish
  107. end
  108.  
  109. set -l userdatadir ~/.local/share
  110.  
  111. if set -q XDG_DATA_HOME
  112.     set userdatadir $XDG_DATA_HOME
  113. end
  114.  
  115. # __fish_data_dir, __fish_sysconf_dir, __fish_help_dir, __fish_bin_dir
  116. # are expected to have been set up by read_init from fish.cpp
  117.  
  118. # Grab extra directories (as specified by the build process, usually for
  119. # third-party packages to ship completions &c.
  120. set -l __extra_completionsdir
  121. set -l __extra_functionsdir
  122. set -l __extra_confdir
  123. if test -f $__fish_data_dir/__fish_build_paths.fish
  124.     source $__fish_data_dir/__fish_build_paths.fish
  125. end
  126.  
  127. # Set up function and completion paths. Make sure that the fish
  128. # default functions/completions are included in the respective path.
  129.  
  130. if not set -q fish_function_path
  131.     set fish_function_path $__fish_config_dir/functions $__fish_sysconf_dir/functions $__extra_functionsdir $__fish_data_dir/functions
  132. end
  133.  
  134. if not contains -- $__fish_data_dir/functions $fish_function_path
  135.     set fish_function_path $fish_function_path $__fish_data_dir/functions
  136. end
  137.  
  138. if not set -q fish_complete_path
  139.     set fish_complete_path $__fish_config_dir/completions $__fish_sysconf_dir/completions $__extra_completionsdir $__fish_data_dir/completions $userdatadir/fish/generated_completions
  140. end
  141.  
  142. if not contains -- $__fish_data_dir/completions $fish_complete_path
  143.     set fish_complete_path $fish_complete_path $__fish_data_dir/completions
  144. end
  145.  
  146. # This cannot be in an autoload-file because `:.fish` is an invalid filename on windows.
  147. function :
  148.     # no-op function for compatibility with sh, bash, and others.
  149.     # Often used to insert a comment into a chain of commands without having
  150.     # it eat up the remainder of the line, handy in Makefiles.
  151. end
  152.  
  153. #
  154. # This is a Solaris-specific test to modify the PATH so that
  155. # Posix-conformant tools are used by default. It is separate from the
  156. # other PATH code because this directory needs to be prepended, not
  157. # appended, since it contains POSIX-compliant replacements for various
  158. # system utilities.
  159. #
  160.  
  161. if test -d /usr/xpg4/bin
  162.     if not contains -- /usr/xpg4/bin $PATH
  163.         set PATH /usr/xpg4/bin $PATH
  164.     end
  165. end
  166.  
  167. # Add a handler for when fish_user_path changes, so we can apply the same changes to PATH
  168. function __fish_reconstruct_path -d "Update PATH when fish_user_paths changes" --on-variable fish_user_paths
  169.     set -l local_path $PATH
  170.  
  171.     for x in $__fish_added_user_paths
  172.         set -l idx (contains --index -- $x $local_path)
  173.         and set -e local_path[$idx]
  174.     end
  175.  
  176.     set -g __fish_added_user_paths
  177.     if set -q fish_user_paths
  178.         for x in $fish_user_paths[-1..1]
  179.             if set -l idx (contains --index -- $x $local_path)
  180.                 set -e local_path[$idx]
  181.             else
  182.                 set -g __fish_added_user_paths $__fish_added_user_paths $x
  183.             end
  184.             set local_path $x $local_path
  185.         end
  186.     end
  187.  
  188.     set -xg PATH $local_path
  189. end
  190.  
  191. #
  192. # Launch debugger on SIGTRAP
  193. #
  194. function fish_sigtrap_handler --on-signal TRAP --no-scope-shadowing --description "Signal handler for the TRAP signal. Launches a debug prompt."
  195.     breakpoint
  196. end
  197.  
  198. #
  199. # Whenever a prompt is displayed, make sure that interactive
  200. # mode-specific initializations have been performed.
  201. # This handler removes itself after it is first called.
  202. #
  203. function __fish_on_interactive --on-event fish_prompt
  204.     __fish_config_interactive
  205.     functions -e __fish_on_interactive
  206. end
  207.  
  208. # Set the locale if it isn't explicitly set. Allowing the lack of locale env vars to imply the
  209. # C/POSIX locale causes too many problems. Do this before reading the snippets because they might be
  210. # in UTF-8 (with non-ASCII characters).
  211. __fish_set_locale
  212.  
  213. # "." command for compatibility with old fish versions.
  214. function . --description 'Evaluate contents of file (deprecated, see "source")' --no-scope-shadowing
  215.     if test (count $argv) -eq 0
  216.         # Uses tty directly, as isatty depends on "."
  217.         and tty 0>&0 >/dev/null
  218.         echo "source: '.' command is deprecated, and doesn't work with STDIN anymore. Did you mean 'source' or './'?" >&2
  219.         return 1
  220.     else
  221.         source $argv
  222.     end
  223. end
  224.  
  225. # Upgrade pre-existing abbreviations from the old "key=value" to the new "key value" syntax.
  226. # This needs to be in share/config.fish because __fish_config_interactive is called after sourcing
  227. # config.fish, which might contain abbr calls.
  228. if not set -q __fish_init_2_3_0
  229.     if set -q fish_user_abbreviations
  230.         set -l fab
  231.         for abbr in $fish_user_abbreviations
  232.             set fab $fab (string replace -r '^([^ =]+)=(.*)$' '$1 $2' -- $abbr)
  233.         end
  234.         set fish_user_abbreviations $fab
  235.     end
  236.     set -U __fish_init_2_3_0
  237. end
  238.  
  239. # macOS-ism: Emulate calling path_helper.
  240. if command -sq /usr/libexec/path_helper
  241.     # Adapt construct_path from the macOS /usr/libexec/path_helper
  242.     # executable for fish; see
  243.     # https://opensource.apple.com/source/shell_cmds/shell_cmds-203/path_helper/path_helper.c.auto.html .
  244.     function __fish_macos_set_env -d "set an environment variable like path_helper does (macOS only)"
  245.         set -l result
  246.  
  247.         for path_file in $argv[2] $argv[3]/*
  248.             if test -f $path_file
  249.                 while read -l entry
  250.                     if not contains $entry $result
  251.                         set result $result $entry
  252.                     end
  253.                 end <$path_file
  254.             end
  255.         end
  256.  
  257.         for entry in $$argv[1]
  258.             if not contains $entry $result
  259.                 set result $result $entry
  260.             end
  261.         end
  262.  
  263.         set -xg $argv[1] $result
  264.     end
  265.  
  266.     __fish_macos_set_env 'PATH' '/etc/paths' '/etc/paths.d'
  267.     if [ -n "$MANPATH" ]
  268.         __fish_macos_set_env 'MANPATH' '/etc/manpaths' '/etc/manpaths.d'
  269.     end
  270.     functions -e __fish_macos_set_env
  271. end
  272.  
  273.  
  274. #
  275. # Some things should only be done for login terminals
  276. # This used to be in etc/config.fish - keep it here to keep the semantics
  277. #
  278.  
  279. if status --is-login
  280.     #
  281.     # Put linux consoles in unicode mode.
  282.     #
  283.     if test "$TERM" = linux
  284.         if string match -qir '.UTF' -- $LANG
  285.             if command -sq unicode_start
  286.                 unicode_start
  287.             end
  288.         end
  289.     end
  290. end
  291.  
  292. # Invoke this here to apply the current value of fish_user_path after
  293. # PATH is possibly set above.
  294. __fish_reconstruct_path
  295.  
  296. # Allow %n job expansion to be used with fg/bg/wait
  297. # `jobs` is the only one that natively supports job expansion
  298. function __fish_expand_pid_args
  299.     for arg in $argv
  300.         if string match -qr '^%d+$' -- $arg
  301.             # set newargv $newargv (jobs -p $arg)
  302.             jobs -p $arg
  303.             if not test $status -eq 0
  304.                 return 1
  305.             end
  306.         else
  307.             printf "%sn" $arg
  308.         end
  309.     end
  310. end
  311.  
  312. function bg
  313.     builtin bg (__fish_expand_pid_args $argv)
  314. end
  315.  
  316. function fg
  317.     builtin fg (__fish_expand_pid_args $argv)
  318. end
  319.  
  320. function kill
  321.     command kill (__fish_expand_pid_args $argv)
  322. end
  323.  
  324. function wait
  325.     builtin wait (__fish_expand_pid_args $argv)
  326. end
  327.  
  328. function disown
  329.     builtin disown (__fish_expand_pid_args $argv)
  330. end
  331.  
  332. # As last part of initialization, source the conf directories.
  333. # Implement precedence (User > Admin > Extra (e.g. vendors) > Fish) by basically doing "basename".
  334. set -l sourcelist
  335. for file in $__fish_config_dir/conf.d/*.fish $__fish_sysconf_dir/conf.d/*.fish $__extra_confdir/*.fish
  336.     set -l basename (string replace -r '^.*/' '' -- $file)
  337.     contains -- $basename $sourcelist
  338.     and continue
  339.     set sourcelist $sourcelist $basename
  340.     # Also skip non-files or unreadable files.
  341.     # This allows one to use e.g. symlinks to /dev/null to "mask" something (like in systemd).
  342.     [ -f $file -a -r $file ]
  343.     and source $file
  344. end
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top