pax_global_header00006660000000000000000000000064136210027270014512gustar00rootroot0000000000000052 comment=9b7b4b91c66f7254bce5c07b9729ea8828563c8e fish-3.1.0/000077500000000000000000000000001362100272700124445ustar00rootroot00000000000000fish-3.1.0/.clang-format000066400000000000000000000006051362100272700150200ustar00rootroot00000000000000# Use the Google style with these modifications: # # 1) lines can be up to 100 chars long rather than 80, and # 2) use a four space indent rather than two spaces. # BasedOnStyle: Google ColumnLimit: 100 IndentWidth: 4 # Place config.h first always. IncludeCategories: - Regex: '^"config.h"' Priority: -1 # We don't want OCLint pragmas to be reformatted. CommentPragmas: '^!OCLINT' fish-3.1.0/.cppcheck.rules000066400000000000000000000014301362100272700153540ustar00rootroot00000000000000 wcwidth \( wcwidthForbidden warning Always use fish_wcwidth rather than wcwidth. wcswidth \( wcswidthForbidden warning Always use fish_wcswidth rather than wcswidth. <--!> ]]> fish-3.1.0/.cppcheck.suppressions000066400000000000000000000013341362100272700170020ustar00rootroot00000000000000// suppress all instances of varFuncNullUB: "Passing NULL after the last typed // argument to a variadic function leads to undefined behaviour." That's // because all the places we do this are valid and won't cause problems even // on a ILP64 platform because we're careful about using NULL rather than 0. varFuncNullUB // Suppress the warning about unmatched suppressions. At the moment these // warnings are emitted even when removing the suppression comment results in // the warning being suppressed. In other words this unmatchedSuppression // warnings are false positives. unmatchedSuppression // Suppress this one because it reports assert(condition && "message"), which we use all over the place incorrectStringBooleanError fish-3.1.0/.editorconfig000066400000000000000000000004711362100272700151230ustar00rootroot00000000000000root = true [*] indent_size = 4 indent_style = space end_of_line = lf charset = utf-8 trim_trailing_whitespace = true insert_final_newline = true max_line_length = 100 [{Makefile,*.in}] indent_style = tab [*.{md,rst}] trim_trailing_whitespace = false [*.{sh,ac}] indent_size = 2 [Dockerfile] indent_size = 2 fish-3.1.0/.oclint000066400000000000000000000074161362100272700137450ustar00rootroot00000000000000rules: rule-configurations: # # This is the default value (as of the time I wrote this) but I'm making # it explicit since it needs to agree with the value used by clang-format. # Thus, if we ever change the fish style to allow longer or shorter lines # this should be changed (as well as the corresponding .clang-format file). # - key: LONG_LINE value: 100 # # The default limit for the length of variable names is 20. Long names are # problematic but twenty chars results in way too many errors. So increase # the limit to something more reasonable. # - key: LONG_VARIABLE_NAME value: 30 # # This allows us to avoid peppering our code with inline comments such as # # scoped_lock locker(m_lock); //!OCLINT(side-effect) # # Specifically, this config key tells oclint that the named classes have # RAII behavior so the local vars are actually used. # - key: RAII_CUSTOM_CLASSES value: scoped_lock scoped_buffer_t builtin_commandline_scoped_transient_t scoped_push # We're slightly more persmissive regarding the total number of lines in a # function. Default is 50. - key: LONG_METHOD value: 60 # We're slightly more persmissive regarding the number of non-comment # lines in a function. Default is 30. - key: NCSS_METHOD value: 40 # We're willing to allow slighly more linearly independent paths through a # function. Most of our code has a lot of `switch` blocks or consecutive # `if` tests that are straightforward to interpret but which increase this # metric. Default is 10. - key: CYCLOMATIC_COMPLEXITY value: 14 # We're willing to allow slighly more execution paths through a function. # Default is 200. - key: NPATH_COMPLEXITY value: 300 disable-rules: # # A few instances of "useless parentheses" errors are meaningful. Mostly # in the context of the `return` statement. Unfortunately the vast # majority would result in removing parentheses that decreases # readability. So we're going to ignore this warning and rely on humans to # notice when the parentheses are truly not needed. # # Also, some macro expansions, such as FD_SET(), trigger this warning and # we don't want to suppress each of those individually. # - UselessParentheses # # OCLint wants variable names to be at least three characters in length. # Which would be fine if it supported a reasonable set of exceptions # (e.g., "i", "j", "k") and allowed adding additional exceptions to match # conventions employed by a project. Since it doesn't, and thus generates # a lot of really annoying warnings, we're going to disable this rule. # - ShortVariableName # # This rule flags perfectly reasonable conditions like `if (!some_condition)` # and is therefore just noise. Disable this rule. # - InvertedLogic # # The idea behind the "double negative" rule is sound since constructs # like "!!(var & flag)" should be written as "static_cast(var & # flag)". Unfortunately this rule has way too many false positives; # especially in the context of assert statements. So disable this rule. # - DoubleNegative # # Avoiding bitwise operators in a conditional is a good idea with one # exception: testing whether a bit flag is set. Which happens to be the # only time you'll see something like `if (j->flags & JOB_CONSTRUCTED)` # in fish source. # - BitwiseOperatorInConditional # # I don't think I've ever seen a case where assigning a value to a # parameter inside the function body was unclear, let along dangerous or # an error. This rule is therefore just noise. Disable this rule. # - ParameterReassignment fish-3.1.0/BSDmakefile000066400000000000000000000024531362100272700145010ustar00rootroot00000000000000# This is a very basic `make` wrapper around the CMake build toolchain. # # Supported arguments: # PREFIX: sets the installation prefix # GENERATOR: explicitly specifies the CMake generator to use # By default, bmake will try to cd into ./obj before anything else. Don't do that. .OBJDIR: ./ CMAKE?=cmake # Before anything else, test for CMake, which is the only requirement to be able to run # this Makefile CMake will perform the remaining dependency tests on its own. .BEGIN: @which $(CMAKE) >/dev/null 2>/dev/null || \ (echo 'Please install CMake and then re-run the `make` command!' 1>&2 && false) # Prefer to use ninja, if it is installed _GENERATOR!=which ninja 2>/dev/null >/dev/null && echo Ninja || echo "Unix Makefiles" GENERATOR?=$(_GENERATOR) .if $(GENERATOR) == "Ninja" BUILDFILE=build/build.ninja .else BUILDFILE=build/Makefile .endif PREFIX?=/usr/local build/fish: build/$(BUILDFILE) $(CMAKE) --build build build: mkdir -p build build/$(BUILDFILE): build cd build; $(CMAKE) .. -G "$(GENERATOR)" -DCMAKE_INSTALL_PREFIX="$(PREFIX)" -DCMAKE_EXPORT_COMPILE_COMMANDS=1 .PHONY: install install: build/fish $(CMAKE) --build build --target install .PHONY: clean clean: rm -rf build .PHONY: test test: build/fish $(CMAKE) --build build --target test .PHONY: run run: build/fish build/fish fish-3.1.0/CHANGELOG.md000066400000000000000000002521571362100272700142710ustar00rootroot00000000000000# fish 3.1.0 (released February 12, 2020) Compared to the beta release of fish 3.1b1, fish version 3.1.0: - fixes a regression where spaces after a brace were removed despite brace expansion not occurring (#6564) - fixes a number of problems in compiling and testing on Cygwin (#6549) and Solaris-derived systems such as Illumos (#6553, #6554, #6555, #6556, and #6558); - fixes the process for building macOS packages; - fixes a regression where excessive error messages are printed if Unicode characters are emitted in non-Unicode-capable locales (#6584); and - contains some improvements to the documentation and a small number of completions. If you are upgrading from version 3.0.0 or before, please also review the release notes for 3.1b1 (included below). --- # fish 3.1b1 (released January 26, 2020) ## Notable improvements and fixes - A new `$pipestatus` variable contains a list of exit statuses of the previous job, for each of the separate commands in a pipeline (#5632). - fish no longer buffers pipes to the last function in a pipeline, improving many cases where pipes appeared to block or hang (#1396). - An overhaul of error messages for builtin commands, including a removal of the overwhelming usage summary, more readable stack traces (#3404, #5434), and stack traces for `test` (aka `[`) (#5771). - fish's debugging arguments have been significantly improved. The `--debug-level` option has been removed, and a new `--debug` option replaces it. This option accepts various categories, which may be listed via `fish --print-debug-categories` (#5879). A new `--debug-output` option allows for redirection of debug output. - `string` has a new `collect` subcommand for use in command substitutions, producing a single output instead of splitting on new lines (similar to `"$(cmd)"` in other shells) (#159). - The fish manual, tutorial and FAQ are now available in `man` format as `fish-doc`, `fish-tutorial` and `fish-faq` respectively (#5521). - Like other shells, `cd` now always looks for its argument in the current directory as a last resort, even if the `CDPATH` variable does not include it or "." (#4484). - fish now correctly handles `CDPATH` entries that start with `..` (#6220) or contain `./` (#5887). - The `fish_trace` variable may be set to trace execution (#3427). This performs a similar role as `set -x` in other shells. - fish uses the temporary directory determined by the system, rather than relying on `/tmp` (#3845). - The fish Web configuration tool (`fish_config`) prints a list of commands it is executing, to help understanding and debugging (#5584). - Major performance improvements when pasting (#5866), executing lots of commands (#5905), importing history from bash (#6295), and when completing variables that might match `$history` (#6288). ### Syntax changes and new commands - A new builtin command, `time`, which allows timing of fish functions and builtins as well as external commands (#117). - Brace expansion now only takes place if the braces include a "," or a variable expansion, meaning common commands such as `git reset HEAD@{0}` do not require escaping (#5869). - New redirections `&>` and `&|` may be used to redirect or pipe stdout, and also redirect stderr to stdout (#6192). - `switch` now allows arguments that expand to nothing, like empty variables (#5677). - The `VAR=val cmd` syntax can now be used to run a command in a modified environment (#6287). - `and` is no longer recognised as a command, so that nonsensical constructs like `and and and` produce a syntax error (#6089). - `math`'s exponent operator, '`^`', was previously left-associative, but now uses the more commonly-used right-associative behaviour (#6280). This means that `math '3^0.5^2'` was previously calculated as '(3^0.5)^2', but is now calculated as '3^(0.5^2)'. - In fish 3.0, the variable used with `for` loops inside command substitutions could leak into enclosing scopes; this was an inadvertent behaviour change and has been reverted (#6480). ### Scripting improvements - `string split0` now returns 0 if it split something (#5701). - In the interest of consistency, `builtin -q` and `command -q` can now be used to query if a builtin or command exists (#5631). - `math` now accepts `--scale=max` for the maximum scale (#5579). - `builtin $var` now works correctly, allowing a variable as the builtin name (#5639). - `cd` understands the `--` argument to make it possible to change to directories starting with a hyphen (#6071). - `complete --do-complete` now also does fuzzy matches (#5467). - `complete --do-complete` can be used inside completions, allowing limited recursion (#3474). - `count` now also counts lines fed on standard input (#5744). - `eval` produces an exit status of 0 when given no arguments, like other shells (#5692). - `printf` prints what it can when input hasn't been fully converted to a number, but still prints an error (#5532). - `complete -C foo` now works as expected, rather than requiring `complete -Cfoo`. - `complete` has a new `--force-files` option, to re-enable file completions. This allows `sudo -E` and `pacman -Qo` to complete correctly (#5646). - `argparse` now defaults to showing the current function name (instead of `argparse`) in its errors, making `--name` often superfluous (#5835). - `argparse` has a new `--ignore-unknown` option to keep unrecognized options, allowing multiple argparse passes to parse options (#5367). - `argparse` correctly handles flag value validation of options that only have short names (#5864). - `read -S` (short option of `--shell`) is recognised correctly (#5660). - `read` understands `--list`, which acts like `--array` in reading all arguments into a list inside a single variable, but is better named (#5846). - `read` has a new option, `--tokenize`, which splits a string into variables according to the shell's tokenization rules, considering quoting, escaping, and so on (#3823). - `read` interacts more correctly with the deprecated `$IFS` variable, in particular removing multiple separators when splitting a variable into a list (#6406), matching other shells. - `fish_indent` now handles semicolons better, including leaving them in place for `; and` and `; or` instead of breaking the line (#5859). - `fish_indent --write` now supports multiple file arguments, indenting them in turn. - The default read limit has been increased to 100MiB (#5267). - `math` now also understands `x` for multiplication, provided it is followed by whitespace (#5906). - `math` reports the right error when incorrect syntax is used inside parentheses (#6063), and warns when unsupported logical operations are used (#6096). - `functions --erase` now also prevents fish from autoloading a function for the first time (#5951). - `jobs --last` returns 0 to indicate success when a job is found (#6104). - `commandline -p` and `commandline -j` now split on `&&` and `||` in addition to `;` and `&` (#6214). - A bug where `string split` would drop empty strings if the output was only empty strings has been fixed (#5987). - `eval` no long creates a new local variable scope, but affects variables in the scope it is called from (#4443). `source` still creates a new local scope. - `abbr` has a new `--query` option to check for the existence of an abbreviation. - Local values for `fish_complete_path` and `fish_function_path` are now ignored; only their global values are respected. - Syntax error reports now display a marker in the correct position (#5812). - Empty universal variables may now be exported (#5992). - Exported universal variables are no longer imported into the global scope, preventing shadowing. This makes it easier to change such variables for all fish sessions and avoids breakage when the value is a list of multiple elements (#5258). - A bug where `for` could use invalid variable names has been fixed (#5800). - A bug where local variables would not be exported to functions has been fixed (#6153). - The null command (`:`) now always exits successfully, rather than passing through the previous exit status (#6022). - The output of `functions FUNCTION` matches the declaration of the function, correctly including comments or blank lines (#5285), and correctly includes any `--wraps` flags (#1625). - `type` supports a new option, `--short`, which suppress function expansion (#6403). - `type --path` with a function argument will now output the path to the file containing the definition of that function, if it exists. - `type --force-path` with an argument that cannot be found now correctly outputs nothing, as documented (#6411). - The `$hostname` variable is no longer truncated to 32 characters (#5758). - Line numbers in function backtraces are calculated correctly (#6350). - A new `fish_cancel` event is emitted when the command line is cancelled, which is useful for terminal integration (#5973). ### Interactive improvements - New Base16 color options are available through the Web-based configuration (#6504). - fish only parses `/etc/paths` on macOS in login shells, matching the bash implementation (#5637) and avoiding changes to path ordering in child shells (#5456). It now ignores blank lines like the bash implementation (#5809). - The locale is now reloaded when the `LOCPATH` variable is changed (#5815). - `read` no longer keeps a history, making it suitable for operations that shouldn't end up there, like password entry (#5904). - `dirh` outputs its stack in the correct order (#5477), and behaves as documented when universal variables are used for its stack (#5797). - `funced` and the edit-commandline-in-buffer bindings did not work in fish 3.0 when the `$EDITOR` variable contained spaces; this has been corrected (#5625). - Builtins now pipe their help output to a pager automatically (#6227). - `set_color` now colors the `--print-colors` output in the matching colors if it is going to a terminal. - fish now underlines every valid entered path instead of just the last one (#5872). - When syntax highlighting a string with an unclosed quote, only the quote itself will be shown as an error, instead of the whole argument. - Syntax highlighting works correctly with variables as commands (#5658) and redirections to close file descriptors (#6092). - `help` works properly on Windows Subsytem for Linux (#5759, #6338). - A bug where `disown` could crash the shell has been fixed (#5720). - fish will not autosuggest files ending with `~` unless there are no other candidates, as these are generally backup files (#985). - Escape in the pager works correctly (#5818). - Key bindings that call `fg` no longer leave the terminal in a broken state (#2114). - Brackets (#5831) and filenames containing `$` (#6060) are completed with appropriate escaping. - The output of `complete` and `functions` is now colorized in interactive terminals. - The Web-based configuration handles aliases that include single quotes correctly (#6120), and launches correctly under Termux (#6248) and OpenBSD (#6522). - `function` now correctly validates parameters for `--argument-names` as valid variable names (#6147) and correctly parses options following `--argument-names`, as in "`--argument-names foo --description bar`" (#6186). - History newly imported from bash includes command lines using `&&` or `||`. - The automatic generation of completions from manual pages is better described in job and process listings, and no longer produces a warning when exiting fish (#6269). - In private mode, setting `$fish_greeting` to an empty string before starting the private session will prevent the warning about history not being saved from being printed (#6299). - In the interactive editor, a line break (Enter) inside unclosed brackets will insert a new line, rather than executing the command and producing an error (#6316). - Ctrl-C always repaints the prompt (#6394). - When run interactively from another program (such as Python), fish will correctly start a new process group, like other shells (#5909). - Job identifiers (for example, for background jobs) are assigned more logically (#6053). - A bug where history would appear truncated if an empty command was executed was fixed (#6032). #### New or improved bindings - Pasting strips leading spaces to avoid pasted commands being omitted from the history (#4327). - Shift-Left and Shift-Right now default to moving backwards and forwards by one bigword (words separated by whitespace) (#1505). - The default escape delay (to differentiate between the escape key and an alt-combination) has been reduced to 30ms, down from 300ms for the default mode and 100ms for Vi mode (#3904). - The `forward-bigword` binding now interacts correctly with autosuggestions (#5336). - The `fish_clipboard_*` functions support Wayland by using [`wl-clipboard`](https://github.com/bugaevc/wl-clipboard) (#5450). - The `nextd` and `prevd` functions no longer print "Hit end of history", instead using a bell. They correctly store working directories containing symbolic links (#6395). - If a `fish_mode_prompt` function exists, Vi mode will only execute it on mode-switch instead of the entire prompt. This should make it much more responsive with slow prompts (#5783). - The path-component bindings (like Ctrl-w) now also stop at ":" and "@", because those are used to denote user and host in commands such as `ssh` (#5841). - The NULL character can now be bound via `bind -k nul`. Terminals often generate this character via control-space. (#3189). - A new readline command `expand-abbr` can be used to trigger abbreviation expansion (#5762). - A new readline command, `delete-or-exit`, removes a character to the right of the cursor or exits the shell if the command line is empty (moving this functionality out of the `delete-or-exit` function). - The `self-insert` readline command will now insert the binding sequence, if not empty. - A new binding to prepend `sudo`, bound to Alt-S by default (#6140). - The Alt-W binding to describe a command should now work better with multiline prompts (#6110) - The Alt-H binding to open a command's man page now tries to ignore `sudo` (#6122). - A new pair of bind functions, `history-prefix-search-backward` (and `forward`), was introduced (#6143). - Vi mode now supports R to enter replace mode (#6342), and `d0` to delete the current line (#6292). - In Vi mode, hitting Enter in replace-one mode no longer erases the prompt (#6298). - Selections in Vi mode are inclusive, matching the actual behaviour of Vi (#5770). #### Improved prompts - The Git prompt in informative mode now shows the number of stashes if enabled. - The Git prompt now has an option (`$__fish_git_prompt_use_informative_chars`) to use the (more modern) informative characters without enabling informative mode. - The default prompt now also features VCS integration and will color the host if running via SSH (#6375). - The default and example prompts print the pipe status if an earlier command in the pipe fails. - The default and example prompts try to resolve exit statuses to signal names when appropriate. #### Improved terminal output - New `fish_pager_color_` options have been added to control more elements of the pager's colors (#5524). - Better detection and support for using fish from various system consoles, where limited colors and special characters are supported (#5552). - fish now tries to guess if the system supports Unicode 9 (and displays emoji as wide), eliminating the need to set `$fish_emoji_width` in most cases (#5722). - Improvements to the display of wide characters, particularly Korean characters and emoji (#5583, #5729). - The Vi mode cursor is correctly redrawn when regaining focus under terminals that report focus (eg tmux) (#4788). - Variables that control background colors (such as `fish_pager_color_search_match`) can now use `--reverse`. #### Completions - Added completions for - `aws` - `bat` (#6052) - `bosh` (#5700) - `btrfs` - `camcontrol` - `cf` (#5700) - `chronyc` (#6496) - `code` (#6205) - `cryptsetup` (#6488) - `csc` and `csi` (#6016) - `cwebp` (#6034) - `cygpath` and `cygstart` (#6239) - `epkginfo` (#5829) - `ffmpeg`, `ffplay`, and `ffprobe` (#5922) - `fsharpc` and `fsharpi` (#6016) - `fzf` (#6178) - `g++` (#6217) - `gpg1` (#6139) - `gpg2` (#6062) - `grub-mkrescue` (#6182) - `hledger` (#6043) - `hwinfo` (#6496) - `irb` (#6260) - `iw` (#6232) - `kak` - `keepassxc-cli` (#6505) - `keybase` (#6410) - `loginctl` (#6501) - `lz4`, `lz4c` and `lz4cat` (#6364) - `mariner` (#5718) - `nethack` (#6240) - `patool` (#6083) - `phpunit` (#6197) - `plutil` (#6301) - `pzstd` (#6364) - `qubes-gpg-client` (#6067) - `resolvectl` (#6501) - `rg` - `rustup` - `sfdx` (#6149) - `speedtest` and `speedtest-cli` (#5840) - `src` (#6026) - `tokei` (#6085) - `tsc` (#6016) - `unlz4` (#6364) - `unzstd` (#6364) - `vbc` (#6016) - `zpaq` (#6245) - `zstd`, `zstdcat`, `zstdgrep`, `zstdless` and `zstdmt` (#6364) - Lots of improvements to completions. - Selecting short options which also have a long name from the completion pager is possible (#5634). - Tab completion will no longer add trailing spaces if they already exist (#6107). - Completion of subcommands to builtins like `and` or `not` now works correctly (#6249). - Completion of arguments to short options works correctly when multiple short options are used together (#332). - Activating completion in the middle of an invalid completion does not move the cursor any more, making it easier to fix a mistake (#4124). - Completion in empty commandlines now lists all available commands. - Functions listed as completions could previously leak parts of the function as other completions; this has been fixed. ### Deprecations and removed features - The vcs-prompt functions have been promoted to names without double-underscore, so __fish_git_prompt is now fish_git_prompt, __fish_vcs_prompt is now fish_vcs_prompt, __fish_hg_prompt is now fish_hg_prompt and __fish_svn_prompt is now fish_svn_prompt. Shims at the old names have been added, and the variables have kept their old names (#5586). - `string replace` has an additional round of escaping in the replacement expression, so escaping backslashes requires many escapes (eg `string replace -ra '([ab])' '\\\\\\\$1' a`). The new feature flag `regex-easyesc` can be used to disable this, so that the same effect can be achieved with `string replace -ra '([ab])' '\\\\$1' a` (#5556). As a reminder, the intention behind feature flags is that this will eventually become the default and then only option, so scripts should be updated. - The `fish_vi_mode` function, deprecated in fish 2.3, has been removed. Use `fish_vi_key_bindings` instead (#6372). ### For distributors and developers - fish 3.0 introduced a CMake-based build system. In fish 3.1, both the Autotools-based build and legacy Xcode build system have been removed, leaving only the CMake build system. All distributors and developers must install CMake. - fish now depends on the common `tee` external command, for the `psub` process substitution function. - The documentation is now built with Sphinx. The old Doxygen-based documentation system has been removed. Developers, and distributors who wish to rebuild the documentation, must install Sphinx. - The `INTERNAL_WCWIDTH` build option has been removed, as fish now always uses an internal `wcwidth` function. It has a number of configuration options that make it more suitable for general use (#5777). - mandoc can now be used to format the output from `--help` if `nroff` is not installed, reducing the number of external dependencies on systems with `mandoc` installed (#5489). - Some bugs preventing building on Solaris-derived systems such as Illumos were fixed (#5458, #5461, #5611). - Completions for `npm`, `bower` and `yarn` no longer require the `jq` utility for full functionality, but will use Python instead if it is available. - The paths for completions, functions and configuration snippets have been extended. On systems that define `XDG_DATA_DIRS`, each of the directories in this variable are searched in the subdirectories `fish/vendor_completions.d`, `fish/vendor_functions.d`, and `fish/vendor_conf.d` respectively. On systems that do not define this variable in the environment, the vendor directories are searched for in both the installation prefix and the default "extra" directory, which now defaults to `/usr/local` (#5029). --- # fish 3.0.2 (released February 19, 2019) This release of fish fixes an issue discovered in fish 3.0.1. ### Fixes and improvements - The PWD environment variable is now ignored if it does not resolve to the true working directory, fixing strange behaviour in terminals started by editors and IDEs (#5647). If you are upgrading from version 2.7.1 or before, please also review the release notes for 3.0.1, 3.0.0 and 3.0b1 (included below). --- # fish 3.0.1 (released February 11, 2019) This release of fish fixes a number of major issues discovered in fish 3.0.0. ### Fixes and improvements - `exec` does not complain about running foreground jobs when called (#5449). - while loops now evaluate to the last executed command in the loop body (or zero if the body was empty), matching POSIX semantics (#4982). - `read --silent` no longer echoes to the tty when run from a non-interactive script (#5519). - On macOS, path entries with spaces in `/etc/paths` and `/etc/paths.d` now correctly set path entries with spaces. Likewise, `MANPATH` is correctly set from `/etc/manpaths` and `/etc/manpaths.d` (#5481). - fish starts correctly under Cygwin/MSYS2 (#5426). - The `pager-toggle-search` binding (Ctrl-S by default) will now activate the search field, even when the pager is not focused. - The error when a command is not found is now printed a single time, instead of once per argument (#5588). - Fixes and improvements to the git completions, including printing correct paths with older git versions, fuzzy matching again, reducing unnecessary offers of root paths (starting with `:/`) (#5578, #5574, #5476), and ignoring shell aliases, so enterprising users can set up the wrapping command (via `set -g __fish_git_alias_$command $whatitwraps`) (#5412). - Significant performance improvements to core shell functions (#5447) and to the `kill` completions (#5541). - Starting in symbolically-linked working directories works correctly (#5525). - The default `fish_title` function no longer contains extra spaces (#5517). - The `nim` prompt now works correctly when chosen in the Web-based configuration (#5490). - `string` now prints help to stdout, like other builtins (#5495). - Killing the terminal while fish is in vi normal mode will no longer send it spinning and eating CPU. (#5528) - A number of crashes have been fixed (#5550, #5548, #5479, #5453). - Improvements to the documentation and certain completions. ### Known issues There is one significant known issue that was not corrected before the release: - fish does not run correctly under Windows Services for Linux before Windows 10 version 1809/17763, and the message warning of this may not be displayed (#5619). If you are upgrading from version 2.7.1 or before, please also review the release notes for 3.0.0 and 3.0b1 (included below). --- # fish 3.0.0 (released December 28, 2018) fish 3 is a major release, which introduces some breaking changes alongside improved functionality. Although most existing scripts will continue to work, they should be reviewed against the list contained in the 3.0b1 release notes below. Compared to the beta release of fish 3.0b1, fish version 3.0.0: - builds correctly against musl libc (#5407) - handles huge numeric arguments to `test` correctly (#5414) - removes the history colouring introduced in 3.0b1, which did not always work correctly There is one significant known issue which was not able to be corrected before the release: - fish 3.0.0 builds on Cygwin (#5423), but does not run correctly (#5426) and will result in a hanging terminal when started. Cygwin users are encouraged to continue using 2.7.1 until a release which corrects this is available. If you are upgrading from version 2.7.1 or before, please also review the release notes for 3.0b1 (included below). --- # fish 3.0b1 (released December 11, 2018) fish 3 is a major release, which introduces some breaking changes alongside improved functionality. Although most existing scripts will continue to work, they should be reviewed against the list below. ## Notable non-backward compatible changes - Process and job expansion has largely been removed. `%` will no longer perform these expansions, except for `%self` for the PID of the current shell. Additionally, job management commands (`disown`, `wait`, `bg`, `fg` and `kill`) will expand job specifiers starting with `%` (#4230, #1202). - `set x[1] x[2] a b`, to set multiple elements of an array at once, is no longer valid syntax (#4236). - A literal `{}` now expands to itself, rather than nothing. This makes working with `find -exec` easier (#1109, #4632). - Literally accessing a zero-index is now illegal syntax and is caught by the parser (#4862). (fish indices start at 1) - Successive commas in brace expansions are handled in less surprising manner. For example, `{,,,}` expands to four empty strings rather than an empty string, a comma and an empty string again (#3002, #4632). - `for` loop control variables are no longer local to the `for` block (#1935). - Variables set in `if` and `while` conditions are available outside the block (#4820). - Local exported (`set -lx`) vars are now visible to functions (#1091). - The new `math` builtin (see below) does not support logical expressions; `test` should be used instead (#4777). - Range expansion will now behave sensibly when given a single positive and negative index (`$foo[5..-1]` or `$foo[-1..5]`), clamping to the last valid index without changing direction if the list has fewer elements than expected. - `read` now uses `-s` as short for `--silent` (à la `bash`); `--shell`'s abbreviation (formerly `-s`) is now `-S` instead (#4490). - `cd` no longer resolves symlinks. fish now maintains a virtual path, matching other shells (#3350). - `source` now requires an explicit `-` as the filename to read from the terminal (#2633). - Arguments to `end` are now errors, instead of being silently ignored. - The names `argparse`, `read`, `set`, `status`, `test` and `[` are now reserved and not allowed as function names. This prevents users unintentionally breaking stuff (#3000). - The `fish_user_abbreviations` variable is no longer used; abbreviations will be migrated to the new storage format automatically. - The `FISH_READ_BYTE_LIMIT` variable is now called `fish_byte_limit` (#4414). - Environment variables are no longer split into arrays based on the record separator character on startup. Instead, variables are not split, unless their name ends in PATH, in which case they are split on colons (#436). - The `history` builtin's `--with-time` option has been removed; this has been deprecated in favor of `--show-time` since 2.7.0 (#4403). - The internal variables `__fish_datadir` and `__fish_sysconfdir` are now known as `__fish_data_dir` and `__fish_sysconf_dir` respectively. ## Deprecations With the release of fish 3, a number of features have been marked for removal in the future. All users are encouraged to explore alternatives. A small number of these features are currently behind feature flags, which are turned on at present but may be turned off by default in the future. A new feature flags mechanism is added for staging deprecations and breaking changes. Feature flags may be specified at launch with `fish --features ...` or by setting the universal `fish_features` variable. (#4940) - The use of the `IFS` variable for `read` is deprecated; `IFS` will be ignored in the future (#4156). Use the `read --delimiter` option instead. - The `function --on-process-exit` switch will be removed in future (#4700). Use the `fish_exit` event instead: `function --on-event fish_exit`. - `$_` is deprecated and will removed in the future (#813). Use `status current-command` in a command substitution instead. - `^` as a redirection deprecated and will be removed in the future. (#4394). Use `2>` to redirect stderr. This is controlled by the `stderr-nocaret` feature flag. - `?` as a glob (wildcard) is deprecated and will be removed in the future (#4520). This is controlled by the `qmark-noglob` feature flag. ## Notable fixes and improvements ### Syntax changes and new commands - fish now supports `&&` (like `and`), `||` (like `or`), and `!` (like `not`), for better migration from POSIX-compliant shells (#4620). - Variables may be used as commands (#154). - fish may be started in private mode via `fish --private`. Private mode fish sessions do not have access to the history file and any commands evaluated in private mode are not persisted for future sessions. A session variable `$fish_private_mode` can be queried to detect private mode and adjust the behavior of scripts accordingly to respect the user's wish for privacy. - A new `wait` command for waiting on backgrounded processes (#4498). - `math` is now a builtin rather than a wrapper around `bc` (#3157). Floating point computations is now used by default, and can be controlled with the new `--scale` option (#4478). - Setting `$PATH` no longer warns on non-existent directories, allowing for a single $PATH to be shared across machines (eg via dotfiles) (#2969). - `while` sets `$status` to a non-zero value if the loop is not executed (#4982). - Command substitution output is now limited to 10 MB by default, controlled by the `fish_read_limit` variable (#3822). Notably, this is larger than most operating systems' argument size limit, so trying to pass argument lists this size to external commands has never worked. - The machine hostname, where available, is now exposed as the `$hostname` reserved variable. This removes the dependency on the `hostname` executable (#4422). - Bare `bind` invocations in config.fish now work. The `fish_user_key_bindings` function is no longer necessary, but will still be executed if it exists (#5191). - `$fish_pid` and `$last_pid` are available as replacements for `%self` and `%last`. ### New features in commands - `alias` has a new `--save` option to save the generated function immediately (#4878). - `bind` has a new `--silent` option to ignore bind requests for named keys not available under the current terminal (#4188, #4431). - `complete` has a new `--keep-order` option to show the provided or dynamically-generated argument list in the same order as specified, rather than alphabetically (#361). - `exec` prompts for confirmation if background jobs are running. - `funced` has a new `--save` option to automatically save the edited function after successfully editing (#4668). - `functions` has a new ` --handlers` option to show functions registered as event handlers (#4694). - `history search` supports globs for wildcard searching (#3136) and has a new `--reverse` option to show entries from oldest to newest (#4375). - `jobs` has a new `--quiet` option to silence the output. - `read` has a new `--delimiter` option for splitting input into arrays (#4256). - `read` writes directly to stdout if called without arguments (#4407). - `read` can now read individual lines into separate variables without consuming the input in its entirety via the new `/--line` option. - `set` has new `--append` and `--prepend` options (#1326). - `string match` with an empty pattern and `--entire` in glob mode now matches everything instead of nothing (#4971). - `string split` supports a new `--no-empty` option to exclude empty strings from the result (#4779). - `string` has new subcommands `split0` and `join0` for working with NUL-delimited output. - `string` no longer stops processing text after NUL characters (#4605) - `string escape` has a new `--style regex` option for escaping strings to be matched literally in `string` regex operations. - `test` now supports floating point values in numeric comparisons. ### Interactive improvements - A pipe at the end of a line now allows the job to continue on the next line (#1285). - Italics and dim support out of the box on macOS for Terminal.app and iTerm (#4436). - `cd` tab completions no longer descend into the deepest unambiguous path (#4649). - Pager navigation has been improved. Most notably, moving down now wraps around, moving up from the commandline now jumps to the last element and moving right and left now reverse each other even when wrapping around (#4680). - Typing normal characters while the completion pager is active no longer shows the search field. Instead it enters them into the command line, and ends paging (#2249). - A new input binding `pager-toggle-search` toggles the search field in the completions pager on and off. By default, this is bound to Ctrl-S. - Searching in the pager now does a full fuzzy search (#5213). - The pager will now show the full command instead of just its last line if the number of completions is large (#4702). - Abbreviations can be tab-completed (#3233). - Tildes in file names are now properly escaped in completions (#2274). - Wrapping completions (from `complete --wraps` or `function --wraps`) can now inject arguments. For example, `complete gco --wraps 'git checkout'` now works properly (#1976). The `alias` function has been updated to respect this behavior. - Path completions now support expansions, meaning expressions like `python ~/` now provides file suggestions just like any other relative or absolute path. (This includes support for other expansions, too.) - Autosuggestions try to avoid arguments that are already present in the command line. - Notifications about crashed processes are now always shown, even in command substitutions (#4962). - The screen is no longer reset after a BEL, fixing graphical glitches (#3693). - vi-mode now supports ';' and ',' motions. This introduces new {forward,backward}-jump-till and repeat-jump{,-reverse} bind functions (#5140). - The `*y` vi-mode binding now works (#5100). - True color is now enabled in neovim by default (#2792). - Terminal size variables (`$COLUMNS`/`$LINES`) are now updated before `fish_prompt` is called, allowing the prompt to react (#904). - Multi-line prompts no longer repeat when the terminal is resized (#2320). - `xclip` support has been added to the clipboard integration (#5020). - The Alt-P keybinding paginates the last command if the command line is empty. - `$cmd_duration` is no longer reset when no command is executed (#5011). - Deleting a one-character word no longer erases the next word as well (#4747). - Token history search (Alt-Up) omits duplicate entries (#4795). - The `fish_escape_delay_ms` timeout, allowing the use of the escape key both on its own and as part of a control sequence, was applied to all control characters; this has been reduced to just the escape key. - Completing a function shows the description properly (#5206). - Added completions for - `ansible`, including `ansible-galaxy`, `ansible-playbook` and `ansible-vault` (#4697) - `bb-power` (#4800) - `bd` (#4472) - `bower` - `clang` and `clang++` (#4174) - `conda` (#4837) - `configure` (for autoconf-generated files only) - `curl` - `doas` (#5196) - `ebuild` (#4911) - `emaint` (#4758) - `eopkg` (#4600) - `exercism` (#4495) - `hjson` - `hugo` (#4529) - `j` (from autojump #4344) - `jbake` (#4814) - `jhipster` (#4472) - `kitty` - `kldload` - `kldunload` - `makensis` (#5242) - `meson` - `mkdocs` (#4906) - `ngrok` (#4642) - OpenBSD's `pkg_add`, `pkg_delete`, `pkg_info`, `pfctl`, `rcctl`, `signify`, and `vmctl` (#4584) - `openocd` - `optipng` - `opkg` (#5168) - `pandoc` (#2937) - `port` (#4737) - `powerpill` (#4800) - `pstack` (#5135) - `serve` (#5026) - `ttx` - `unzip` - `virsh` (#5113) - `xclip` (#5126) - `xsv` - `zfs` and `zpool` (#4608) - Lots of improvements to completions (especially `darcs` (#5112), `git`, `hg` and `sudo`). - Completions for `yarn` and `npm` now require the `all-the-package-names` NPM package for full functionality. - Completions for `bower` and `yarn` now require the `jq` utility for full functionality. - Improved French translations. ### Other fixes and improvements - Significant performance improvements to `abbr` (#4048), setting variables (#4200, #4341), executing functions, globs (#4579), `string` reading from standard input (#4610), and slicing history (in particular, `$history[1]` for the last executed command). - Fish's internal wcwidth function has been updated to deal with newer Unicode, and the width of some characters can be configured via the `fish_ambiguous_width` (#5149) and `fish_emoji_width` (#2652) variables. Alternatively, a new build-time option INTERNAL_WCWIDTH can be used to use the system's wcwidth instead (#4816). - `functions` correctly supports `-d` as the short form of `--description`. (#5105) - `/etc/paths` is now parsed like macOS' bash `path_helper`, fixing $PATH order (#4336, #4852) on macOS. - Using a read-only variable in a `for` loop produces an error, rather than silently producing incorrect results (#4342). - The universal variables filename no longer contains the hostname or MAC address. It is now at the fixed location `.config/fish/fish_variables` (#1912). - Exported variables in the global or universal scope no longer have their exported status affected by local variables (#2611). - Major rework of terminal and job handling to eliminate bugs (#3805, #3952, #4178, #4235, #4238, #4540, #4929, #5210). - Improvements to the manual page completion generator (#2937, #4313). - `suspend --force` now works correctly (#4672). - Pressing Ctrl-C while running a script now reliably terminates fish (#5253). ### For distributors and developers - fish ships with a new build system based on CMake. CMake 3.2 is the minimum required version. Although the autotools-based Makefile and the Xcode project are still shipped with this release, they will be removed in the near future. All distributors and developers are encouraged to migrate to the CMake build. - Build scripts for most platforms no longer require bash, using the standard sh instead. - The `hostname` command is no longer required for fish to operate. -- # fish 2.7.1 (released December 23, 2017) This release of fish fixes an issue where iTerm 2 on macOS would display a warning about paste bracketing being left on when starting a new fish session (#4521). If you are upgrading from version 2.6.0 or before, please also review the release notes for 2.7.0 and 2.7b1 (included below). -- # fish 2.7.0 (released November 23, 2017) There are no major changes between 2.7b1 and 2.7.0. If you are upgrading from version 2.6.0 or before, please also review the release notes for 2.7b1 (included below). Xcode builds and macOS packages could not be produced with 2.7b1, but this is fixed in 2.7.0. -- # fish 2.7b1 (released October 31, 2017) ## Notable improvements - A new `cdh` (change directory using recent history) command provides a more friendly alternative to prevd/nextd and pushd/popd (#2847). - A new `argparse` command is available to allow fish script to parse arguments with the same behavior as builtin commands. This also includes the `fish_opt` helper command. (#4190). - Invalid array indexes are now silently ignored (#826, #4127). - Improvements to the debugging facility, including a prompt specific to the debugger (`fish_breakpoint_prompt`) and a `status is-breakpoint` subcommand (#1310). - `string` supports new `lower` and `upper` subcommands, for altering the case of strings (#4080). The case changing is not locale-aware yet.- `string escape` has a new `--style=xxx` flag where `xxx` can be `script`, `var`, or `url` (#4150), and can be reversed with `string unescape` (#3543). - History can now be split into sessions with the `fish_history` variable, or not saved to disk at all (#102). - Read history is now controlled by the `fish_history` variable rather than the `--mode-name` flag (#1504). - `command` now supports an `--all` flag to report all directories with the command. `which` is no longer a runtime dependency (#2778). - fish can run commands before starting an interactive session using the new `--init-command`/`-C` options (#4164). - `set` has a new `--show` option to show lots of information about variables (#4265). ## Other significant changes - The `COLUMNS` and `LINES` environment variables are now correctly set the first time `fish_prompt` is run (#4141). - `complete`'s `--no-files` option works as intended (#112). - `echo -h` now correctly echoes `-h` in line with other shells (#4120). - The `export` compatibility function now returns zero on success, rather than always returning 1 (#4435). - Stop converting empty elements in MANPATH to "." (#4158). The behavior being changed was introduced in fish 2.6.0. - `count -h` and `count --help` now return 1 rather than produce command help output (#4189). - An attempt to `read` which stops because too much data is available still defines the variables given as parameters (#4180). - A regression in fish 2.4.0 which prevented `pushd +1` from working has been fixed (#4091). - A regression in fish 2.6.0 where multiple `read` commands in non-interactive scripts were broken has been fixed (#4206). - A regression in fish 2.6.0 involving universal variables with side-effects at startup such as `set -U fish_escape_delay_ms 10` has been fixed (#4196). - Added completions for: - `as` (#4130) - `cdh` (#2847) - `dhcpd` (#4115) - `ezjail-admin` (#4324) - Fabric's `fab` (#4153) - `grub-file` (#4119) - `grub-install` (#4119) - `jest` (#4142) - `kdeconnect-cli` - `magneto` (#4043, #4108) - `mdadm` (#4198) - `passwd` (#4209) - `pip` and `pipenv` (#4448) - `s3cmd` (#4332) - `sbt` (#4347) - `snap` (#4215) - Sublime Text 3's `subl` (#4277) - Lots of improvements to completions. - Updated Chinese and French translations. - Improved completions for: - `apt` - `cd` (#4061) - `composer` (#4295) - `eopkg` - `flatpak` (#4456) - `git` (#4117, #4147, #4329, #4368) - `gphoto2` - `killall` (#4052) - `ln` - `npm` (#4241) - `ssh` (#4377) - `tail` - `xdg-mime` (#4333) - `zypper` (#4325) --- # fish 2.6.0 (released June 3, 2017) Since the beta release of fish 2.6b1, fish version 2.6.0 contains a number of minor fixes, new completions for `magneto` (#4043), and improvements to the documentation. ## Known issues - Apple macOS Sierra 10.12.5 introduced a problem with launching web browsers from other programs using AppleScript. This affects the fish Web configuration (`fish_config`); users on these platforms will need to manually open the address displayed in the terminal, such as by copying and pasting it into a browser. This problem will be fixed with macOS 10.12.6. If you are upgrading from version 2.5.0 or before, please also review the release notes for 2.6b1 (included below). --- # fish 2.6b1 (released May 14, 2017) ## Notable fixes and improvements - Jobs running in the background can now be removed from the list of jobs with the new `disown` builtin, which behaves like the same command in other shells (#2810). - Command substitutions now have access to the terminal, like in other shells. This allows tools like `fzf` to work properly (#1362, #3922). - In cases where the operating system does not report the size of the terminal, the `COLUMNS` and `LINES` environment variables are used; if they are unset, a default of 80x24 is assumed. - New French (#3772 & #3788) and improved German (#3834) translations. - fish no longer depends on the `which` external command. ## Other significant changes - Performance improvements in launching processes, including major reductions in signal blocking. Although this has been heavily tested, it may cause problems in some circumstances; set the `FISH_NO_SIGNAL_BLOCK` variable to 0 in your fish configuration file to return to the old behaviour (#2007). - Performance improvements in prompts and functions that set lots of colours (#3793). - The Delete key no longer deletes backwards (a regression in 2.5.0). - `functions` supports a new `--details` option, which identifies where the function was loaded from (#3295), and a `--details --verbose` option which includes the function description (#597). - `read` will read up to 10 MiB by default, leaving the target variable empty and exiting with status 122 if the line is too long. You can set a different limit with the `FISH_READ_BYTE_LIMIT` variable. - `read` supports a new `--silent` option to hide the characters typed (#838), for when reading sensitive data from the terminal. `read` also now accepts simple strings for the prompt (rather than scripts) with the new `-P` and `--prompt-str` options (#802). - `export` and `setenv` now understand colon-separated `PATH`, `CDPATH` and `MANPATH` variables. - `setenv` is no longer a simple alias for `set -gx` and will complain, just like the csh version, if given more than one value (#4103). - `bind` supports a new `--list-modes` option (#3872). - `bg` will check all of its arguments before backgrounding any jobs; any invalid arguments will cause a failure, but non-existent (eg recently exited) jobs are ignored (#3909). - `funced` warns if the function being edited has not been modified (#3961). - `printf` correctly outputs "long long" integers (#3352). - `status` supports a new `current-function` subcommand to print the current function name (#1743). - `string` supports a new `repeat` subcommand (#3864). `string match` supports a new `--entire` option to emit the entire line matched by a pattern (#3957). `string replace` supports a new `--filter` option to only emit lines which underwent a replacement (#3348). - `test` supports the `-k` option to test for sticky bits (#733). - `umask` understands symbolic modes (#738). - Empty components in the `CDPATH`, `MANPATH` and `PATH` variables are now converted to "." (#2106, #3914). - New versions of ncurses (6.0 and up) wipe terminal scrollback buffers with certain commands; the `C-l` binding tries to avoid this (#2855). - Some systems' `su` implementations do not set the `USER` environment variable; it is now reset for root users (#3916). - Under terminals which support it, bracketed paste is enabled, escaping problematic characters for security and convience (#3871). Inside single quotes (`'`), single quotes and backslashes in pasted text are escaped (#967). The `fish_clipboard_paste` function (bound to `C-v` by default) is still the recommended pasting method where possible as it includes this functionality and more. - Processes in pipelines are no longer signalled as soon as one command in the pipeline has completed (#1926). This behaviour matches other shells mre closely. - All functions requiring Python work with whichever version of Python is installed (#3970). Python 3 is preferred, but Python 2.6 remains the minimum version required. - The color of the cancellation character can be controlled by the `fish_color_cancel` variable (#3963). - Added completions for: - `caddy` (#4008) - `castnow` (#3744) - `climate` (#3760) - `flatpak` - `gradle` (#3859) - `gsettings` (#4001) - `helm` (#3829) - `i3-msg` (#3787) - `ipset` (#3924) - `jq` (#3804) - `light` (#3752) - `minikube` (#3778) - `mocha` (#3828) - `mkdosfs` (#4017) - `pv` (#3773) - `setsid` (#3791) - `terraform` (#3960) - `usermod` (#3775) - `xinput` - `yarn` (#3816) - Improved completions for `adb` (#3853), `apt` (#3771), `bzr` (#3769), `dconf`, `git` (including #3743), `grep` (#3789), `go` (#3789), `help` (#3789), `hg` (#3975), `htop` (#3789), `killall` (#3996), `lua`, `man` (#3762), `mount` (#3764 & #3841), `obnam` (#3924), `perl` (#3856), `portmaster` (#3950), `python` (#3840), `ssh` (#3781), `scp` (#3781), `systemctl` (#3757) and `udisks` (#3764). --- # fish 2.5.0 (released February 3, 2017) There are no major changes between 2.5b1 and 2.5.0. If you are upgrading from version 2.4.0 or before, please also review the release notes for 2.5b1 (included below). ## Notable fixes and improvements - The Home, End, Insert, Delete, Page Up and Page Down keys work in Vi-style key bindings (#3731). --- # fish 2.5b1 (released January 14, 2017) ## Platform Changes Starting with version 2.5, fish requires a more up-to-date version of C++, specifically C++11 (from 2011). This affects some older platforms: ### Linux For users building from source, GCC's g++ 4.8 or later, or LLVM's clang 3.3 or later, are known to work. Older platforms may require a newer compiler installed. Unfortunately, because of the complexity of the toolchain, binary packages are no longer published by the fish-shell developers for the following platforms: - Red Hat Enterprise Linux and CentOS 5 & 6 for 64-bit builds - Ubuntu 12.04 (EoLTS April 2017) - Debian 7 (EoLTS May 2018) Installing newer version of fish on these systems will require building from source. ### OS X SnowLeopard Starting with version 2.5, fish requires a C++11 standard library on OS X 10.6 ("SnowLeopard"). If this library is not installed, you will see this error: `dyld: Library not loaded: /usr/lib/libc++.1.dylib` MacPorts is the easiest way to obtain this library. After installing the SnowLeopard MacPorts release from the install page, run: ``` sudo port -v install libcxx ``` Now fish should launch successfully. (Please open an issue if it does not.) This is only necessary on 10.6. OS X 10.7 and later include the required library by default. ## Other significant changes - Attempting to exit with running processes in the background produces a warning, then signals them to terminate if a second attempt to exit is made. This brings the behaviour for running background processes into line with stopped processes. (#3497) - `random` can now have start, stop and step values specified, or the new `choice` subcommand can be used to pick an argument from a list (#3619). - A new key bindings preset, `fish_hybrid_key_bindings`, including all the Emacs-style and Vi-style bindings, which behaves like `fish_vi_key_bindings` in fish 2.3.0 (#3556). - `function` now returns an error when called with invalid options, rather than defining the function anyway (#3574). This was a regression present in fish 2.3 and 2.4.0. - fish no longer prints a warning when it identifies a running instance of an old version (2.1.0 and earlier). Changes to universal variables may not propagate between these old versions and 2.5b1. - Improved compatiblity with Android (#3585), MSYS/mingw (#2360), and Solaris (#3456, #3340). - Like other shells, the `test` builting now returns an error for numeric operations on invalid integers (#3346, #3581). - `complete` no longer recognises `--authoritative` and `--unauthoritative` options, and they are marked as obsolete. - `status` accepts subcommands, and should be used like `status is-interactive`. The old options continue to be supported for the foreseeable future (#3526), although only one subcommand or option can be specified at a time. - Selection mode (used with "begin-selection") no longer selects a character the cursor does not move over (#3684). - List indexes are handled better, and a bit more liberally in some cases (`echo $PATH[1 .. 3]` is now valid) (#3579). - The `fish_mode_prompt` function is now simply a stub around `fish_default_mode_prompt`, which allows the mode prompt to be included more easily in customised prompt functions (#3641). ## Notable fixes and improvements - `alias`, run without options or arguments, lists all defined aliases, and aliases now include a description in the function signature that identifies them. - `complete` accepts empty strings as descriptions (#3557). - `command` accepts `-q`/`--quiet` in combination with `--search` (#3591), providing a simple way of checking whether a command exists in scripts. - Abbreviations can now be renamed with `abbr --rename OLD_KEY NEW_KEY` (#3610). - The command synopses printed by `--help` options work better with copying and pasting (#2673). - `help` launches the browser specified by the `$fish_help_browser variable` if it is set (#3131). - History merging could lose items under certain circumstances and is now fixed (#3496). - The `$status` variable is now set to 123 when a syntactically invalid command is entered (#3616). - Exiting fish now signals all background processes to terminate, not just stopped jobs (#3497). - A new `prompt_hostname` function which prints a hostname suitable for use in prompts (#3482). - The `__fish_man_page` function (bound to Alt-h by default) now tries to recognize subcommands (e.g. `git add` will now open the "git-add" man page) (#3678). - A new function `edit_command_buffer` (bound to Alt-e & Alt-v by default) to edit the command buffer in an external editor (#1215, #3627). - `set_color` now supports italics (`--italics`), dim (`--dim`) and reverse (`--reverse`) modes (#3650). - Filesystems with very slow locking (eg incorrectly-configured NFS) will no longer slow fish down (#685). - Improved completions for `apt` (#3695), `fusermount` (#3642), `make` (#3628), `netctl-auto` (#3378), `nmcli` (#3648), `pygmentize` (#3378), and `tar` (#3719). - Added completions for: - `VBoxHeadless` (#3378) - `VBoxSDL` (#3378) - `base64` (#3378) - `caffeinate` (#3524) - `dconf` (#3638) - `dig` (#3495) - `dpkg-reconfigure` (#3521 & #3522) - `feh` (#3378) - `launchctl` (#3682) - `lxc` (#3554 & #3564), - `mddiagnose` (#3524) - `mdfind` (#3524) - `mdimport` (#3524) - `mdls` (#3524) - `mdutil` (#3524) - `mkvextract` (#3492) - `nvram` (#3524) - `objdump` (#3378) - `sysbench` (#3491) - `tmutil` (#3524) --- # fish 2.4.0 (released November 8, 2016) There are no major changes between 2.4b1 and 2.4.0. ## Notable fixes and improvements - The documentation is now generated properly and with the correct version identifier. - Automatic cursor changes are now only enabled on the subset of XTerm versions known to support them, resolving a problem where older versions printed garbage to the terminal before and after every prompt (#3499). - Improved the title set in Apple Terminal.app. - Added completions for `defaults` and improved completions for `diskutil` (#3478). --- # fish 2.4b1 (released October 18, 2016) ## Significant changes - The clipboard integration has been revamped with explicit bindings. The killring commands no longer copy from, or paste to, the X11 clipboard - use the new copy (`C-x`) and paste (`C-v`) bindings instead. The clipboard is now available on OS X as well as systems using X11 (e.g. Linux). (#3061) - `history` uses subcommands (`history delete`) rather than options (`history --delete`) for its actions (#3367). You can no longer specify multiple actions via flags (e.g., `history --delete --save something`). - New `history` options have been added, including `--max=n` to limit the number of history entries, `--show-time` option to show timestamps (#3175, #3244), and `--null` to null terminate history entries in the search output. - `history search` is now case-insensitive by default (which also affects `history delete`) (#3236). - `history delete` now correctly handles multiline commands (#31). - Vi-style bindings no longer include all of the default emacs-style bindings; instead, they share some definitions (#3068). - If there is no locale set in the environment, various known system configuration files will be checked for a default. If no locale can be found, `en_US-UTF.8` will be used (#277). - A number followed by a caret (e.g. `5^`) is no longer treated as a redirection (#1873). - The `$version` special variable can be overwritten, so that it can be used for other purposes if required. ## Notable fixes and improvements - The `fish_realpath` builtin has been renamed to `realpath` and made compatible with GNU `realpath` when run without arguments (#3400). It is used only for systems without a `realpath` or `grealpath` utility (#3374). - Improved color handling on terminals/consoles with 8-16 colors, particularly the use of bright named color (#3176, #3260). - `fish_indent` can now read from files given as arguments, rather than just standard input (#3037). - Fuzzy tab completions behave in a less surprising manner (#3090, #3211). - `jobs` should only print its header line once (#3127). - Wildcards in redirections are highlighted appropriately (#2789). - Suggestions will be offered more often, like after removing characters (#3069). - `history --merge` now correctly interleaves items in chronological order (#2312). - Options for `fish_indent` have been aligned with the other binaries - in particular, `-d` now means `--debug`. The `--dump` option has been renamed to `--dump-parse-tree` (#3191). - The display of bindings in the Web-based configuration has been greatly improved (#3325), as has the rendering of prompts (#2924). - fish should no longer hang using 100% CPU in the C locale (#3214). - A bug in FreeBSD 11 & 12, Dragonfly BSD & illumos prevented fish from working correctly on these platforms under UTF-8 locales; fish now avoids the buggy behaviour (#3050). - Prompts which show git repository information (via `__fish_git_prompt`) are faster in large repositories (#3294) and slow filesystems (#3083). - fish 2.3.0 reintroduced a problem where the greeting was printed even when using `read`; this has been corrected again (#3261). - Vi mode changes the cursor depending on the current mode (#3215). - Command lines with escaped space characters at the end tab-complete correctly (#2447). - Added completions for: - `arcanist` (#3256) - `connmanctl` (#3419) - `figlet` (#3378) - `mdbook` (#3378) - `ninja` (#3415) - `p4`, the Perforce client (#3314) - `pygmentize` (#3378) - `ranger` (#3378) - Improved completions for `aura` (#3297), `abbr` (#3267), `brew` (#3309), `chown` (#3380, #3383),`cygport` (#3392), `git` (#3274, #3226, #3225, #3094, #3087, #3035, #3021, #2982, #3230), `kill` & `pkill` (#3200), `screen` (#3271), `wget` (#3470), and `xz` (#3378). - Distributors, packagers and developers will notice that the build process produces more succinct output by default; use `make V=1` to get verbose output (#3248). - Improved compatibility with minor platforms including musl (#2988), Cygwin (#2993), Android (#3441, #3442), Haiku (#3322) and Solaris . --- # fish 2.3.1 (released July 3, 2016) This is a functionality and bugfix release. This release does not contain all the changes to fish since the last release, but fixes a number of issues directly affecting users at present and includes a small number of new features. ## Significant changes - A new `fish_key_reader` binary for decoding interactive keypresses (#2991). - `fish_mode_prompt` has been updated to reflect the changes in the way the Vi input mode is set up (#3067), making this more reliable. - `fish_config` can now properly be launched from the OS X app bundle (#3140). ## Notable fixes and improvements - Extra lines were sometimes inserted into the output under Windows (Cygwin and Microsoft Windows Subsystem for Linux) due to TTY timestamps not being updated (#2859). - The `string` builtin's `match` mode now handles the combination of `-rnv` (match, invert and count) correctly (#3098). - Improvements to TTY special character handling (#3064), locale handling (#3124) and terminal environment variable handling (#3060). - Work towards handling the terminal modes for external commands launched from initialisation files (#2980). - Ease the upgrade path from fish 2.2.0 and before by warning users to restart fish if the `string` builtin is not available (#3057). - `type -a` now syntax-colorizes function source output. - Added completions for `alsamixer`, `godoc`, `gofmt`, `goimports`, `gorename`, `lscpu`, `mkdir`, `modinfo`, `netctl-auto`, `poweroff`, `termite`, `udisksctl` and `xz` (#3123). - Improved completions for `apt` (#3097), `aura` (#3102),`git` (#3114), `npm` (#3158), `string` and `suspend` (#3154). --- # fish 2.3.0 (released May 20, 2016) There are no significant changes between 2.3.0 and 2.3b2. ## Other notable fixes and improvements - `abbr` now allows non-letter keys (#2996). - Define a few extra colours on first start (#2987). - Multiple documentation updates. - Added completions for rmmod (#3007). - Improved completions for git (#2998). ## Known issues - Interactive commands started from fish configuration files or from the `-c` option may, under certain circumstances, be started with incorrect terminal modes and fail to behave as expected. A fix is planned but requires further testing (#2619). --- # fish 2.3b2 (released May 5, 2016) ## Significant changes - A new `fish_realpath` builtin and associated function to allow the use of `realpath` even on those platforms that don't ship an appropriate command (#2932). - Alt-# toggles the current command line between commented and uncommented states, making it easy to save a command in history without executing it. - The `fish_vi_mode` function is now deprecated in favour of `fish_vi_key_bindings`. ## Other notable fixes and improvements - Fix the build on Cygwin (#2952) and RedHat Enterprise Linux/CentOS 5 (#2955). - Avoid confusing the terminal line driver with non-printing characters in `fish_title` (#2453). - Improved completions for busctl, git (#2585, #2879, #2984), and netctl. --- # fish 2.3b1 (released April 19, 2016) ## Significant Changes - A new `string` builtin to handle... strings! This builtin will measure, split, search and replace text strings, including using regular expressions. It can also be used to turn lists into plain strings using `join`. `string` can be used in place of `sed`, `grep`, `tr`, `cut`, and `awk` in many situations. (#2296) - Allow using escape as the Meta modifier key, by waiting after seeing an escape character wait up to 300ms for an additional character. This is consistent with readline (e.g. bash) and can be configured via the `fish_escape_delay_ms variable`. This allows using escape as the Meta modifier. (#1356) - Add new directories for vendor functions and configuration snippets (#2500) - A new `fish_realpath` builtin and associated `realpath` function should allow scripts to resolve path names via `realpath` regardless of whether there is an external command of that name; albeit with some limitations. See the associated documentation. ## Backward-incompatible changes - Unmatched globs will now cause an error, except when used with `for`, `set` or `count` (#2719) - `and` and `or` will now bind to the closest `if` or `while`, allowing compound conditions without `begin` and `end` (#1428) - `set -ql` now searches up to function scope for variables (#2502) - `status -f` will now behave the same when run as the main script or using `source` (#2643) - `source` no longer puts the file name in `$argv` if no arguments are given (#139) - History files are stored under the `XDG_DATA_HOME` hierarchy (by default, in `~/.local/share`), and existing history will be moved on first use (#744) ## Other notable fixes and improvements - Fish no longer silences errors in config.fish (#2702) - Directory autosuggestions will now descend as far as possible if there is only one child directory (#2531) - Add support for bright colors (#1464) - Allow Ctrl-J (\cj) to be bound separately from Ctrl-M (\cm) (#217) - psub now has a "-s"/"–suffix" option to name the temporary file with that suffix - Enable 24-bit colors on select terminals (#2495) - Support for SVN status in the prompt (#2582) - Mercurial and SVN support have been added to the Classic + Git (now Classic + VCS) prompt (via the new \__fish_vcs_prompt function) (#2592) - export now handles variables with a "=" in the value (#2403) - New completions for: - alsactl - Archlinux's asp, makepkg - Atom's apm (#2390) - entr - the "Event Notify Test Runner" (#2265) - Fedora's dnf (#2638) - OSX diskutil (#2738) - pkgng (#2395) - pulseaudio's pacmd and pactl - rust's rustc and cargo (#2409) - sysctl (#2214) - systemd's machinectl (#2158), busctl (#2144), systemd-nspawn, systemd-analyze, localectl, timedatectl - and more - Fish no longer has a function called sgrep, freeing it for user customization (#2245) - A rewrite of the completions for cd, fixing a few bugs (#2299, #2300, #562) - Linux VTs now run in a simplified mode to avoid issues (#2311) - The vi-bindings now inherit from the emacs bindings - Fish will also execute `fish_user_key_bindings` when in vi-mode - `funced` will now also check $VISUAL (#2268) - A new `suspend` function (#2269) - Subcommand completion now works better with split /usr (#2141) - The command-not-found-handler can now be overridden by defining a function called `__fish_command_not_found_handler` in config.fish (#2332) - A few fixes to the Sorin theme - PWD shortening in the prompt can now be configured via the `fish_prompt_pwd_dir_length` variable, set to the length per path component (#2473) - fish no longer requires `/etc/fish/config.fish` to correctly start, and now ships a skeleton file that only contains some documentation (#2799) --- # fish 2.2.0 (released July 12, 2015) ### Significant changes ### * Abbreviations: the new `abbr` command allows for interactively-expanded abbreviations, allowing quick access to frequently-used commands (#731). * Vi mode: run `fish_vi_mode` to switch fish into the key bindings and prompt familiar to users of the Vi editor (#65). * New inline and interactive pager, which will be familiar to users of zsh (#291). * Underlying architectural changes: the `fishd` universal variable server has been removed as it was a source of many bugs and security problems. Notably, old fish sessions will not be able to communicate universal variable changes with new fish sessions. For best results, restart all running instances of `fish`. * The web-based configuration tool has been redesigned, featuring a prompt theme chooser and other improvements. * New German, Brazilian Portuguese, and Chinese translations. ### Backward-incompatible changes ### These are kept to a minimum, but either change undocumented features or are too hard to use in their existing forms. These changes may break existing scripts. * `commandline` no longer interprets functions "in reverse", instead behaving as expected (#1567). * The previously-undocumented `CMD_DURATION` variable is now set for all commands and contains the execution time of the last command in milliseconds (#1585). It is no longer exported to other commands (#1896). * `if` / `else` conditional statements now return values consistent with the Single Unix Specification, like other shells (#1443). * A new "top-level" local scope has been added, allowing local variables declared on the commandline to be visible to subsequent commands. (#1908) ### Other notable fixes and improvements ### * New documentation design (#1662), which requires a Doxygen version 1.8.7 or newer to build. * Fish now defines a default directory for other packages to provide completions. By default this is `/usr/share/fish/vendor-completions.d`; on systems with `pkgconfig` installed this path is discoverable with `pkg-config --variable completionsdir fish`. * A new parser removes many bugs; all existing syntax should keep working. * New `fish_preexec` and `fish_postexec` events are fired before and after job execution respectively (#1549). * Unmatched wildcards no longer prevent a job from running. Wildcards used interactively will still print an error, but the job will proceed and the wildcard will expand to zero arguments (#1482). * The `.` command is deprecated and the `source` command is preferred (#310). * `bind` supports "bind modes", which allows bindings to be set for a particular named mode, to support the implementation of Vi mode. * A new `export` alias, which behaves like other shells (#1833). * `command` has a new `--search` option to print the name of the disk file that would be executed, like other shells' `command -v` (#1540). * `commandline` has a new `--paging-mode` option to support the new pager. * `complete` has a new `--wraps` option, which allows a command to (recursively) inherit the completions of a wrapped command (#393), and `complete -e` now correctly erases completions (#380). * Completions are now generated from manual pages by default on the first run of fish (#997). * `fish_indent` can now produce colorized (`--ansi`) and HTML (`--html`) output (#1827). * `functions --erase` now prevents autoloaded functions from being reloaded in the current session. * `history` has a new `--merge` option, to incorporate history from other sessions into the current session (#825). * `jobs` returns 1 if there are no active jobs (#1484). * `read` has several new options: * `--array` to break input into an array (#1540) * `--null` to break lines on NUL characters rather than newlines (#1694) * `--nchars` to read a specific number of characters (#1616) * `--right-prompt` to display a right-hand-side prompt during interactive read (#1698). * `type` has a new `-q` option to suppress output (#1540 and, like other shells, `type -a` now prints all matches for a command (#261). * Pressing F1 now shows the manual page for the current command (#1063). * `fish_title` functions have access to the arguments of the currently running argument as `$argv[1]` (#1542). * The OS command-not-found handler is used on Arch Linux (#1925), nixOS (#1852), openSUSE and Fedora (#1280). * `Alt`+`.` searches backwards in the token history, mapping to the same behavior as inserting the last argument of the previous command, like other shells (#89). * The `SHLVL` environment variable is incremented correctly (#1634 & #1693). * Added completions for `adb` (#1165 & #1211), `apt` (#2018), `aura` (#1292), `composer` (#1607), `cygport` (#1841), `dropbox` (#1533), `elixir` (#1167), `fossil`, `heroku` (#1790), `iex` (#1167), `kitchen` (#2000), `nix` (#1167), `node`/`npm` (#1566), `opam` (#1615), `setfacl` (#1752), `tmuxinator` (#1863), and `yast2` (#1739). * Improved completions for `brew` (#1090 & #1810), `bundler` (#1779), `cd` (#1135), `emerge` (#1840),`git` (#1680, #1834 & #1951), `man` (#960), `modprobe` (#1124), `pacman` (#1292), `rpm` (#1236), `rsync` (#1872), `scp` (#1145), `ssh` (#1234), `sshfs` (#1268), `systemctl` (#1462, #1950 & #1972), `tmux` (#1853), `vagrant` (#1748), `yum` (#1269), and `zypper` (#1787). --- # fish 2.1.2 (released Feb 24, 2015) fish 2.1.2 contains a workaround for a filesystem bug in Mac OS X Yosemite. #1859 Specifically, after installing fish 2.1.1 and then rebooting, "Verify Disk" in Disk Utility will report "Invalid number of hard links." We don't have any reports of data loss or other adverse consequences. fish 2.1.2 avoids triggering the bug, but does not repair an already affected filesystem. To repair the filesystem, you can boot into Recovery Mode and use Repair Disk from Disk Utility. Linux and versions of OS X prior to Yosemite are believed to be unaffected. There are no other changes in this release. --- # fish 2.1.1 (released September 26, 2014) __Important:__ if you are upgrading, stop all running instances of `fishd` as soon as possible after installing this release; it will be restarted automatically. On most systems, there will be no further action required. Note that some environments (where `XDG_RUNTIME_DIR` is set), such as Fedora 20, will require a restart of all running fish processes before universal variables work as intended. Distributors are highly encouraged to call `killall fishd`, `pkill fishd` or similar in installation scripts, or to warn their users to do so. ### Security fixes * The fish_config web interface now uses an authentication token to protect requests and only responds to requests from the local machine with this token, preventing a remote code execution attack. (closing CVE-2014-2914). #1438 * `psub` and `funced` are no longer vulnerable to attacks which allow local privilege escalation and data tampering (closing CVE-2014-2906 and CVE-2014-3856). #1437 * `fishd` uses a secure path for its socket, preventing a local privilege escalation attack (closing CVE-2014-2905). #1436 * `__fish_print_packages` is no longer vulnerable to attacks which would allow local privilege escalation and data tampering (closing CVE-2014-3219). #1440 ### Other fixes * `fishd` now ignores SIGPIPE, fixing crashes using tools like GNU Parallel and which occurred more often as a result of the other `fishd` changes. #1084 & #1690 --- # fish 2.1.0 Significant Changes ------------------- * **Tab completions will fuzzy-match files.** #568 When tab-completing a file, fish will first attempt prefix matches (`foo` matches `foobar`), then substring matches (`ooba` matches `foobar`), and lastly subsequence matches (`fbr` matches `foobar`). For example, in a directory with files foo1.txt, foo2.txt, foo3.txt…, you can type only the numeric part and hit tab to fill in the rest. This feature is implemented for files and executables. It is not yet implemented for options (like `--foobar`), and not yet implemented across path components (like `/u/l/b` to match `/usr/local/bin`). * **Redirections now work better across pipelines.** #110, #877 In particular, you can pipe stderr and stdout together, for example, with `cmd ^&1 | tee log.txt`, or the more familiar `cmd 2>&1 | tee log.txt`. * **A single `%` now expands to the last job backgrounded.** #1008 Previously, a single `%` would pid-expand to either all backgrounded jobs, or all jobs owned by your user. Now it expands to the last job backgrounded. If no job is in the background, it will fail to expand. In particular, `fg %` can be used to put the most recent background job in the foreground. Other Notable Fixes ------------------- * alt-U and alt+C now uppercase and capitalize words, respectively. #995 * VTE based terminals should now know the working directory. #906 * The autotools build now works on Mavericks. #968 * The end-of-line binding (ctrl+E) now accepts autosuggestions. #932 * Directories in `/etc/paths` (used on OS X) are now prepended instead of appended, similar to other shells. #927 * Option-right-arrow (used for partial autosuggestion completion) now works on iTerm2. #920 * Tab completions now work properly within nested subcommands. #913 * `printf` supports \e, the escape character. #910 * `fish_config history` no longer shows duplicate items. #900 * `$fish_user_paths` is now prepended to $PATH instead of appended. #888 * Jobs complete when all processes complete. #876 For example, in previous versions of fish, `sleep 10 | echo Done` returns control immediately, because echo does not read from stdin. Now it does not complete until sleep exits (presumably after 10 seconds). * Better error reporting for square brackets. #875 * fish no longer tries to add `/bin` to `$PATH` unless PATH is totally empty. #852 * History token substitution (alt-up) now works correctly inside subshells. #833 * Flow control is now disabled, freeing up ctrl-S and ctrl-Q for other uses. #814 * sh-style variable setting like `foo=bar` now produces better error messages. #809 * Commands with wildcards no longer produce autosuggestions. #785 * funced no longer freaks out when supplied with no arguments. #780 * fish.app now works correctly in a directory containing spaces. #774 * Tab completion cycling no longer occasionally fails to repaint. #765 * Comments now work in eval'd strings. #684 * History search (up-arrow) now shows the item matching the autosuggestion, if that autosuggestion was truncated. #650 * Ctrl-T now transposes characters, as in other shells. #128 --- # fish 2.0.0 Significant Changes ------------------- * **Command substitutions now modify `$status` #547.** Previously the exit status of command substitutions (like `(pwd)`) was ignored; however now it modifies $status. Furthermore, the `set` command now only sets $status on failure; it is untouched on success. This allows for the following pattern: ```sh if set python_path (which python) ... end ``` Because set does not modify $status on success, the if branch effectively tests whether `which` succeeded, and if so, whether the `set` also succeeded. * **Improvements to $PATH handling.** * There is a new variable, `$fish_user_paths`, which can be set universally, and whose contents are appended to $PATH #527 * /etc/paths and /etc/paths.d are now respected on OS X * fish no longer modifies $PATH to find its own binaries * **Long lines no longer use ellipsis for line breaks**, and copy and paste should no longer include a newline even if the line was broken #300 * **New syntax for index ranges** (sometimes known as "slices") #212 * **fish now supports an `else if` statement** #134 * **Process and pid completion now works on OS X** #129 * **fish is now relocatable**, and no longer depends on compiled-in paths #125 * **fish now supports a right prompt (RPROMPT)** through the fish_right_prompt function #80 * **fish now uses posix_spawn instead of fork when possible**, which is much faster on BSD and OS X #11 Other Notable Fixes ------------------- * Updated VCS completions (darcs, cvs, svn, etc.) * Avoid calling getcwd on the main thread, as it can hang #696 * Control-D (forward delete) no longer stops at a period #667 * Completions for many new commands * fish now respects rxvt's unique keybindings #657 * xsel is no longer built as part of fish. It will still be invoked if installed separately #633 * __fish_filter_mime no longer spews #628 * The --no-execute option to fish no longer falls over when reaching the end of a block #624 * fish_config knows how to find fish even if it's not in the $PATH #621 * A leading space now prevents writing to history, as is done in bash and zsh #615 * Hitting enter after a backslash only goes to a new line if it is followed by whitespace or the end of the line #613 * printf is now a builtin #611 * Event handlers should no longer fire if signals are blocked #608 * set_color is now a builtin #578 * man page completions are now located in a new generated_completions directory, instead of your completions directory #576 * tab now clears autosuggestions #561 * tab completion from within a pair of quotes now attempts to "appropriate" the closing quote #552 * $EDITOR can now be a list: for example, `set EDITOR gvim -f`) #541 * `case` bodies are now indented #530 * The profile switch `-p` no longer crashes #517 * You can now control-C out of `read` #516 * `umask` is now functional on OS X #515 * Avoid calling getpwnam on the main thread, as it can hang #512 * Alt-F or Alt-right-arrow (Option-F or option-right-arrow) now accepts one word of an autosuggestion #435 * Setting fish as your login shell no longer kills OpenSUSE #367 * Backslashes now join lines, instead of creating multiple commands #347 * echo now implements the -e flag to interpret escapes #337 * When the last token in the user's input contains capital letters, use its case in preference to that of the autosuggestion #335 * Descriptions now have their own muted color #279 * Wildcards beginning with a . (for example, `ls .*`) no longer match . and .. #270 * Recursive wildcards now handle symlink loops #268 * You can now delete history items from the fish_config web interface #250 * The OS X build now weak links `wcsdup` and `wcscasecmp` #240 * fish now saves and restores the process group, which prevents certain processes from being erroneously reported as stopped #197 * funced now takes an editor option #187 * Alternating row colors are available in fish pager through `fish_pager_color_secondary` #186 * Universal variable values are now stored based on your MAC address, not your hostname #183 * The caret ^ now only does a stderr redirection if it is the first character of a token, making git users happy #168 * Autosuggestions will no longer cause line wrapping #167 * Better handling of Unicode combining characters #155 * fish SIGHUPs processes more often #138 * fish no longer causes `sudo` to ask for a password every time * fish behaves better under Midnight Commander #121 * `set -e` no longer crashes #100 * fish now will automatically import history from bash, if there is no fish history #66 * Backslashed-newlines inside quoted strings now behave more intuitively #52 * Tab titles should be shown correctly in iTerm2 #47 * scp remote path completion now sometimes works #42 * The `read` builtin no longer shows autosuggestions #29 * Custom key bindings can now be set via the `fish_user_key_bindings` function #21 * All Python scripts now run correctly under both Python 2 and Python 3 #14 * The "accept autosuggestion" key can now be configured #19 * Autosuggestions will no longer suggest invalid commands #6 --- # fishfish Beta r2 Bug Fixes --------- * **Implicit cd** is back, for paths that start with one or two dots, a slash, or a tilde. * **Overrides of default functions should be fixed.** The "internalized scripts" feature is disabled for now. * **Disabled delayed suspend.** This is a strange job-control feature of BSD systems, including OS X. Disabling it frees up Control Y for other purposes; in particular, for yank, which now works on OS X. * **fish_indent is fixed.** In particular, the `funced` and `funcsave` functions work again. * A SIGTERM now ends the whole execution stack again (resolving #13). * Bumped the __fish_config_interactive version number so the default fish_color_autosuggestion kicks in. * fish_config better handles combined term256 and classic colors like "555 yellow". New Features ------------ * **A history builtin**, and associated interactive function that enables deleting history items. Example usage: * Print all history items beginning with echo: `history --prefix echo` * Print all history items containing foo: `history --contains foo` * Interactively delete some items containing foo: `history --delete --contains foo` Credit to @siteshwar for implementation. Thanks @siteshwar! --- # fishfish Beta r1 ## Scripting * No changes! All existing fish scripts, config files, completions, etc. from trunk should continue to work. ## New Features * **Autosuggestions**. Think URL fields in browsers. When you type a command, fish will suggest the rest of the command after the cursor, in a muted gray when possible. You can accept the suggestion with the right arrow key or Ctrl-F. Suggestions come from command history, completions, and some custom code for cd; there's a lot of potential for improvement here. The suggestions are computed on a background pthread, so they never slow down your typing. The autosuggestion feature is incredible. I miss it dearly every time I use anything else. * **term256 support** where available, specifically modern xterms and OS X Lion. You can specify colors the old way ('set_color cyan') or by specifying RGB hex values ('set_color FF3333'); fish will pick the closest supported color. Some xterms do not advertise term256 support either in the $TERM or terminfo max_colors field, but nevertheless support it. For that reason, fish will default into using it on any xterm (but it can be disabled with an environment variable). * **Web-based configuration** page. There is a new function 'fish_config'. This spins up a simple Python web server and opens a browser window to it. From this web page, you can set your shell colors and view your functions, variables, and history; all changes apply immediately to all running shells. Eventually all configuration ought to be supported via this mechanism (but in addition to, not instead of, command line mechanisms). * **Man page completions**. There is a new function 'fish_update_completions'. This function reads all the man1 files from your manpath, removes the roff formatting, parses them to find the commands and options, and outputs fish completions into ~/.config/fish/completions. It won't overwrite existing completion files (except ones that it generated itself). ## Programmatic Changes * fish is now entirely in C++. I have no particular love for C++, but it provides a ready memory-model to replace halloc. We've made an effort to keep it to a sane and portable subset (no C++11, no boost, no going crazy with templates or smart pointers), but we do use the STL and a little tr1. * halloc is entirely gone, replaced by normal C++ ownership semantics. If you don't know what halloc is, well, now you have two reasons to be happy. * All the crufty C data structures are entirely gone. array_list_t, priority_queue_t, hash_table_t, string_buffer_t have been removed and replaced by STL equivalents like std::vector, std::map, and std::wstring. A lot of the string handling now uses std::wstring instead of wchar_t * * fish now spawns pthreads for tasks like syntax highlighting that require blocking I/O. * History has been completely rewritten. History files now use an extensible YAML-style syntax. History "merging" (multiple shells writing to the same history file) now works better. There is now a maximum history length of about 250k items (256 * 1024). * The parser has been "instanced," so you can now create more than one. * Total #LoC has shrunk slightly even with the new features. ## Performance * fish now runs syntax highlighting in a background thread, so typing commands is always responsive even on slow filesystems. * echo, test, and pwd are now builtins, which eliminates many forks. * The files in share/functions and share/completions now get 'internalized' into C strings that get compiled in with fish. This substantially reduces the number of files touched at startup. A consequence is that you cannot change these functions without recompiling, but often other functions depend on these "standard" functions, so changing them is perhaps not a good idea anyways. Here are some system call counts for launching and then exiting fish with the default configuration, on OS X. The first column is fish trunk, the next column is with our changes, and the last column is bash for comparison. This data was collected via dtrace.
before after bash
open 9 4 5
fork 28 14 0
stat 131 85 11
lstat 670 0 0
read 332 80 4
write 172 149 0
The large number of forks relative to bash are due to fish's insanely expensive default prompt, which is unchanged in my version. If we switch to a prompt comparable to bash's (lame) default, the forks drop to 16 with trunk, 4 after our changes. The large reduction in lstat() numbers is due to fish no longer needing to call ttyname() on OS X. We've got some work to do to be as lean as bash, but we're on the right track. fish-3.1.0/CMakeLists.txt000066400000000000000000000213511362100272700152060ustar00rootroot00000000000000CMAKE_MINIMUM_REQUIRED(VERSION 3.2) IF(POLICY CMP0066) CMAKE_POLICY(SET CMP0066 OLD) ENDIF() IF(POLICY CMP0067) CMAKE_POLICY(SET CMP0067 NEW) ENDIF() PROJECT(fish) # We are C++11. SET(CMAKE_CXX_STANDARD 11) SET(DEFAULT_BUILD_TYPE "RelWithDebInfo") # Use the default flags (#6296) but remove -DNDEBUG so that asserts remain enabled. STRING(REPLACE "-DNDEBUG" "" CMAKE_CXX_FLAGS_RELWITHDEBINFO "${CMAKE_CXX_FLAGS_RELWITHDEBINFO}") STRING(REPLACE "-DNDEBUG" "" CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE}") IF(NOT CMAKE_BUILD_TYPE AND NOT CMAKE_CONFIGURATION_TYPES) MESSAGE(STATUS "Setting build type to default '${DEFAULT_BUILD_TYPE}'") SET(CMAKE_BUILD_TYPE "${DEFAULT_BUILD_TYPE}") ENDIF() # Force colored warnings in Ninja's output, if the compiler has -fdiagnostics-color support. # Rationale in https://github.com/ninja-build/ninja/issues/814 if (CMAKE_GENERATOR STREQUAL "Ninja" AND ((CMAKE_CXX_COMPILER_ID STREQUAL "GNU" AND NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 4.9) OR (CMAKE_CXX_COMPILER_ID STREQUAL "Clang" AND NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 3.5) OR (CMAKE_CXX_COMPILER_ID STREQUAL "AppleClang" AND NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 6.0))) set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fdiagnostics-color=always") set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fdiagnostics-color=always") endif() # Enable a whole bunch of warnings, but turn off: # - implicit fallthrough because that does not recognize some cases where it's desired (and I *really* want this one!) # - comment because we use a bunch of those, and they're not really all that harmful. # - address, because that occurs for our mkostemp check (weak-linking requires us to compare `&mkostemp == nullptr`). # - strict-aliasing, because on old GCCs (*Travis*) those are triggered by maybe.h, so you get it every time it is included. # - redundant-move, because we have one that is required on old libc set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wextra \ -Wno-implicit-fallthrough \ -Wno-comment \ -Wno-address \ -Wno-strict-aliasing \ -Wno-redundant-move \ ") # Disable exception handling. ADD_COMPILE_OPTIONS(-fno-exceptions) # Prefer the gold linker because it doesn't emit useless warnings about sys_nerr and _sys_errlist. if (UNIX AND NOT APPLE) EXECUTE_PROCESS(COMMAND ${CMAKE_C_COMPILER} -fuse-ld=gold -Wl,--version ERROR_QUIET OUTPUT_VARIABLE LD_VERSION) if ("${LD_VERSION}" MATCHES "GNU gold") set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -fuse-ld=gold") endif() endif() # Hide the CMake Rules directories in Xcode projects. SOURCE_GROUP("CMake Rules" REGULAR_EXPRESSION "^$") # Put source and header files at top level under targets. SOURCE_GROUP("Source Files" REGULAR_EXPRESSION "^$") SOURCE_GROUP("Header Files" REGULAR_EXPRESSION "^$") SOURCE_GROUP("Builtins" REGULAR_EXPRESSION "builtin_.*") # Support folders. SET_PROPERTY(GLOBAL PROPERTY USE_FOLDERS ON) # Work around issue where archive-built libs go in the wrong place. SET(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${PROJECT_BINARY_DIR}) list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_LIST_DIR}/cmake") IF(CMAKE_CURRENT_SOURCE_DIR STREQUAL CMAKE_CURRENT_BINARY_DIR) SET(FISH_IN_TREE_BUILD TRUE) ELSE() SET(FISH_IN_TREE_BUILD FALSE) ENDIF() # NetBSD does weird things with finding libraries, # making the tests fail by failing to find pcre. # # Keep the rpath used to build. IF(CMAKE_SYSTEM_NAME STREQUAL NetBSD) SET(CMAKE_INSTALL_RPATH_USE_LINK_PATH TRUE) ENDIF() # All objects that the system needs to build fish, except fish.cpp SET(FISH_SRCS src/autoload.cpp src/builtin.cpp src/builtin_bg.cpp src/builtin_bind.cpp src/builtin_block.cpp src/builtin_builtin.cpp src/builtin_cd.cpp src/builtin_command.cpp src/builtin_commandline.cpp src/builtin_complete.cpp src/builtin_contains.cpp src/builtin_disown.cpp src/builtin_echo.cpp src/builtin_emit.cpp src/builtin_exit.cpp src/builtin_fg.cpp src/builtin_function.cpp src/builtin_functions.cpp src/builtin_argparse.cpp src/builtin_history.cpp src/builtin_jobs.cpp src/builtin_math.cpp src/builtin_printf.cpp src/builtin_pwd.cpp src/builtin_random.cpp src/builtin_read.cpp src/builtin_realpath.cpp src/builtin_return.cpp src/builtin_set.cpp src/builtin_set_color.cpp src/builtin_source.cpp src/builtin_status.cpp src/builtin_string.cpp src/builtin_test.cpp src/builtin_ulimit.cpp src/builtin_wait.cpp src/builtin_eval.cpp src/color.cpp src/common.cpp src/complete.cpp src/env.cpp src/env_dispatch.cpp src/env_universal_common.cpp src/event.cpp src/exec.cpp src/expand.cpp src/fallback.cpp src/fish_version.cpp src/function.cpp src/highlight.cpp src/history.cpp src/history_file.cpp src/input.cpp src/input_common.cpp src/intern.cpp src/io.cpp src/iothread.cpp src/kill.cpp src/output.cpp src/pager.cpp src/parse_execution.cpp src/parse_productions.cpp src/parse_tree.cpp src/parse_util.cpp src/parser.cpp src/parser_keywords.cpp src/path.cpp src/postfork.cpp src/proc.cpp src/reader.cpp src/sanity.cpp src/screen.cpp src/signal.cpp src/tinyexpr.cpp src/tnode.cpp src/tokenizer.cpp src/utf8.cpp src/util.cpp src/wcstringutil.cpp src/wgetopt.cpp src/wildcard.cpp src/wutil.cpp src/future_feature_flags.cpp src/redirection.cpp src/topic_monitor.cpp src/flog.cpp src/trace.cpp src/timer.cpp src/null_terminated_array.cpp src/operation_context.cpp ) # Header files are just globbed. FILE(GLOB FISH_HEADERS src/*.h) # Set up config.h INCLUDE(cmake/ConfigureChecks.cmake) INCLUDE(cmake/gettext.cmake) CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/config_cmake.h.in ${CMAKE_CURRENT_BINARY_DIR}/config.h) INCLUDE_DIRECTORIES(${CMAKE_CURRENT_BINARY_DIR}) # Set up standard directories. INCLUDE(GNUInstallDirs) ADD_DEFINITIONS(-D_UNICODE=1 -DLOCALEDIR="${CMAKE_INSTALL_FULL_LOCALEDIR}" -DPREFIX=L"${CMAKE_INSTALL_PREFIX}" -DDATADIR=L"${CMAKE_INSTALL_FULL_DATADIR}" -DSYSCONFDIR=L"${CMAKE_INSTALL_FULL_SYSCONFDIR}" -DBINDIR=L"${CMAKE_INSTALL_FULL_BINDIR}" -DDOCDIR=L"${CMAKE_INSTALL_FULL_DOCDIR}") # Set up the machinery around FISH-BUILD-VERSION-FILE # This defines the FBVF variable. INCLUDE(Version) # Let fish pick up when we're running out of the build directory without installing GET_FILENAME_COMPONENT(REAL_CMAKE_BINARY_DIR "${CMAKE_BINARY_DIR}" REALPATH) GET_FILENAME_COMPONENT(REAL_CMAKE_SOURCE_DIR "${CMAKE_SOURCE_DIR}" REALPATH) ADD_DEFINITIONS(-DCMAKE_BINARY_DIR="${REAL_CMAKE_BINARY_DIR}") ADD_DEFINITIONS(-DCMAKE_SOURCE_DIR="${REAL_CMAKE_SOURCE_DIR}") # Teach fish_version.o to rebuild when FBVF changes. # The standard C++ include detection machinery misses this. SET_SOURCE_FILES_PROPERTIES(src/fish_version.cpp PROPERTIES OBJECT_DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/${FBVF}) # Enable thread-safe errno on Solaris (#5611) ADD_DEFINITIONS(-D_REENTRANT) # Set up PCRE2 INCLUDE(cmake/PCRE2.cmake) # Define a function to link dependencies. FUNCTION(FISH_LINK_DEPS target) TARGET_LINK_LIBRARIES(${target} fishlib) ENDFUNCTION(FISH_LINK_DEPS) # Define libfish.a. ADD_LIBRARY(fishlib STATIC ${FISH_SRCS}) TARGET_SOURCES(fishlib PRIVATE ${FISH_HEADERS}) TARGET_LINK_LIBRARIES(fishlib ${CURSES_LIBRARY} ${CURSES_EXTRA_LIBRARY} Threads::Threads ${CMAKE_DL_LIBS} ${PCRE2_LIB} ${Intl_LIBRARIES} ${ATOMIC_LIBRARY}) # Define fish. ADD_EXECUTABLE(fish src/fish.cpp) FISH_LINK_DEPS(fish) # Define fish_indent. ADD_EXECUTABLE(fish_indent src/fish_indent.cpp src/print_help.cpp) FISH_LINK_DEPS(fish_indent) # Define fish_key_reader. ADD_EXECUTABLE(fish_key_reader src/fish_key_reader.cpp src/print_help.cpp) FISH_LINK_DEPS(fish_key_reader) # Set up the docs. INCLUDE(cmake/Docs.cmake) # A helper for running tests. ADD_EXECUTABLE(fish_test_helper src/fish_test_helper.cpp) # Set up tests. INCLUDE(cmake/Tests.cmake) # Benchmarking support. INCLUDE(cmake/Benchmark.cmake) # Set up install. INCLUDE(cmake/Install.cmake) # Mac app. INCLUDE(cmake/MacApp.cmake) # Lint targets # This could be implemented as target properties, but the script has the useful feature of only # checking the currently-staged commands # The generator expressions below rebuild the command line for the fishlib targets # CMake does not support the "iquote" flag - https://gitlab.kitware.com/cmake/cmake/issues/15491 SET(LINT_ARGS "-D$, -D>" "-I$, -I>") ADD_CUSTOM_TARGET(lint COMMAND build_tools/lint.fish -- ${LINT_ARGS} WORKING_DIRECTORY "${CMAKE_SOURCE_DIR}" ) ADD_CUSTOM_TARGET(lint-all COMMAND build_tools/lint.fish --all -- ${LINT_ARGS} WORKING_DIRECTORY "${CMAKE_SOURCE_DIR}" ) INCLUDE(FeatureSummary) FEATURE_SUMMARY(WHAT ALL) fish-3.1.0/CONTRIBUTING.md000066400000000000000000000360411362100272700147010ustar00rootroot00000000000000# Guidelines For Developers This document provides guidelines for making changes to the fish-shell project. This includes rules for how to format the code, naming conventions, et cetera. Generally known as the style of the code. It also includes recommended best practices such as creating a Travis CI account so you can verify that your changes pass all the tests before making a pull request. See the bottom of this document for help on installing the linting and style reformatting tools discussed in the following sections. Fish source should limit the C++ features it uses to those available in C++11. It should not use exceptions. Before introducing a new dependency, please make it optional with graceful failure if possible. Add any new dependencies to the README.md under the *Running* and/or *Building* sections. ## Versioning The fish version is constructed by the *build_tools/git_version_gen.sh* script. For developers the version is the branch name plus the output of `git describe --always --dirty`. Normally the main part of the version will be the closest annotated tag. Which itself is usually the most recent release number (e.g., `2.6.0`). ## Include What You Use You should not depend on symbols being visible to a `*.cpp` module from `#include` statements inside another header file. In other words if your module does `#include "common.h"` and that header does `#include "signal.h"` your module should not assume the sub-include is present. It should instead directly `#include "signal.h"` if it needs any symbol from that header. That makes the actual dependencies much clearer. It also makes it easy to modify the headers included by a specific header file without having to worry that will break any module (or header) that includes a particular header. To help enforce this rule the `make lint` (and `make lint-all`) command will run the [include-what-you-use](https://include-what-you-use.org/) tool. You can find the IWYU project on [github](https://github.com/include-what-you-use/include-what-you-use). To install the tool on OS X you'll need to add a [formula](https://github.com/jasonmp85/homebrew-iwyu) then install it: ``` brew tap jasonmp85/iwyu brew install iwyu ``` On Ubuntu you can install it via `apt-get`: ``` sudo apt-get install iwyu ``` ## Lint Free Code Automated analysis tools like cppcheck and oclint can point out potential bugs or code that is extremely hard to understand. They also help ensure the code has a consistent style and that it avoids patterns that tend to confuse people. Ultimately we want lint free code. However, at the moment a lot of cleanup is required to reach that goal. For now simply try to avoid introducing new lint. To make linting the code easy there are two make targets: `lint` and `lint-all`. The latter does exactly what the name implies. The former will lint any modified but not committed `*.cpp` files. If there is no uncommitted work it will lint the files in the most recent commit. Fish has custom cppcheck rules in the file `.cppcheck.rule`. These help catch mistakes such as using `wcwidth()` rather than `fish_wcwidth()`. Please add a new rule if you find similar mistakes being made. Fish also depends on `diff` and `expect` for its tests. ### Dealing With Lint Warnings You are strongly encouraged to address a lint warning by refactoring the code, changing variable names, or whatever action is implied by the warning. ### Suppressing Lint Warnings Once in a while the lint tools emit a false positive warning. For example, cppcheck might suggest a memory leak is present when that is not the case. To suppress that cppcheck warning you should insert a line like the following immediately prior to the line cppcheck warned about: ``` // cppcheck-suppress memleak // addr not really leaked ``` The explanatory portion of the suppression comment is optional. For other types of warnings replace "memleak" with the value inside the parenthesis (e.g., "nullPointerRedundantCheck") from a warning like the following: ``` [src/complete.cpp:1727]: warning (nullPointerRedundantCheck): Either the condition 'cmd_node' is redundant or there is possible null pointer dereference: cmd_node. ``` Suppressing oclint warnings is more complicated to describe so I'll refer you to the [OCLint HowTo](http://docs.oclint.org/en/latest/howto/suppress.html#annotations) on the topic. ## Ensuring Your Changes Conform to the Style Guides The following sections discuss the specific rules for the style that should be used when writing fish code. To ensure your changes conform to the style rules you simply need to run ``` build_tools/style.fish ``` before committing your change. That will run `git-clang-format` to rewrite only the lines you're modifying. If you've already committed your changes that's okay since it will then check the files in the most recent commit. This can be useful after you've merged another person's change and want to check that it's style is acceptable. However, in that case it will run `clang-format` to ensure the entire file, not just the lines modified by the commit, conform to the style. If you want to check the style of the entire code base run ``` build_tools/style.fish --all ``` That command will refuse to restyle any files if you have uncommitted changes. ### Configuring Your Editor for Fish C++ Code #### ViM As of ViM 7.4 it does not recognize triple-slash comments as used by Doxygen and the OS X Xcode IDE to flag comments that explain the following C symbol. This means the `gq` key binding to reformat such comments doesn't behave as expected. You can fix that by adding the following to your vimrc: ``` autocmd Filetype c,cpp setlocal comments^=:/// ``` If you use ViM I recommend the [vim-clang-format plugin](https://github.com/rhysd/vim-clang-format) by [@rhysd](https://github.com/rhysd). You can also get ViM to provide reasonably correct behavior by installing http://www.vim.org/scripts/script.php?script_id=2636 #### Emacs If you use Emacs: TBD ### Configuring Your Editor for Fish Scripts If you use ViM: Install [vim-fish](https://github.com/dag/vim-fish), make sure you have syntax and filetype functionality in `~/.vimrc`: ``` syntax enable filetype plugin indent on ``` Then turn on some options for nicer display of fish scripts in `~/.vim/ftplugin/fish.vim`: ``` " Set up :make to use fish for syntax checking. compiler fish " Set this to have long lines wrap inside comments. setlocal textwidth=79 " Enable folding of block structures in fish. setlocal foldmethod=expr ``` If you use Emacs: Install [fish-mode](https://github.com/wwwjfy/emacs-fish) (also available in melpa and melpa-stable) and `(setq-default indent-tabs-mode nil)` for it (via a hook or in `use-package`s ":init" block). It can also be made to run fish_indent via e.g. ```elisp (add-hook 'fish-mode-hook (lambda () (add-hook 'before-save-hook 'fish_indent-before-save))) ``` ### Suppressing Reformatting of C++ Code If you have a good reason for doing so you can tell `clang-format` to not reformat a block of code by enclosing it in comments like this: ``` // clang-format off code to ignore // clang-format on ``` However, as I write this there are no places in the code where we use this and I can't think of any legitimate reasons for exempting blocks of code from clang-format. ## Fish Script Style Guide 1. All fish scripts, such as those in the *share/functions* and *tests* directories, should be formatted using the `fish_indent` command. 1. Function names should be in all lowercase with words separated by underscores. Private functions should begin with an underscore. The first word should be `fish` if the function is unique to fish. 1. The first word of global variable names should generally be `fish` for public vars or `_fish` for private vars to minimize the possibility of name clashes with user defined vars. ## C++ Style Guide 1. The [Google C++ Style Guide](https://google.github.io/styleguide/cppguide.html) forms the basis of the fish C++ style guide. There are two major deviations for the fish project. First, a four, rather than two, space indent. Second, line lengths up to 100, rather than 80, characters. 1. The `clang-format` command is authoritative with respect to indentation, whitespace around operators, etc. 1. All names in code should be `small_snake_case`. No Hungarian notation is used. The names for classes and structs should be followed by `_t`. 1. Always attach braces to the surrounding context. 1. Indent with spaces, not tabs and use four spaces per indent. 1. Document the purpose of a function or class with doxygen-style comment blocks. e.g.: ``` /** * Sum numbers in a vector. * * @param values Container whose values are summed. * @return sum of `values`, or 0.0 if `values` is empty. */ double sum(std::vector & const values) { ... } */ ``` or ``` /// brief description of somefunction() void somefunction() { ``` ## Testing The source code for fish includes a large collection of tests. If you are making any changes to fish, running these tests is mandatory to make sure the behaviour remains consistent and regressions are not introduced. Even if you don't run the tests on your machine, they will still be run via the [Travis CI](https://travis-ci.org/fish-shell/fish-shell) service. You are strongly encouraged to add tests when changing the functionality of fish, especially if you are fixing a bug to help ensure there are no regressions in the future (i.e., we don't reintroduce the bug). ### Local testing The tests can be run on your local computer on all operating systems. ``` cmake path/to/fish-shell make test ``` ### Travis CI Build and Test The Travis Continuous Integration services can be used to test your changes using multiple configurations. This is the same service that the fish-shell project uses to ensure new changes haven't broken anything. Thus it is a really good idea that you leverage Travis CI before making a pull request to avoid potential embarrassment at breaking the build. You will need to [fork the fish-shell repository on GitHub](https://help.github.com/articles/fork-a-repo/), then setup Travis to test your changes before making a pull request. 1. [Sign in to Travis CI](https://travis-ci.org/auth) with your GitHub account, accepting the GitHub access permissions confirmation. 1. Once you're signed in and your repositories are synchronized, go to your [profile page](https://travis-ci.org/profile) and enable the fish-shell repository. 1. Push your changes to GitHub. You'll receive an email when the tests are complete telling you whether or not any tests failed. You'll find the configuration used to control Travis in the `.travis.yml` file. ### Git hooks Since developers sometimes forget to run the tests, it can be helpful to use git hooks (see githooks(5)) to automate it. One possibility is a pre-push hook script like this one: ```sh #!/bin/sh #### A pre-push hook for the fish-shell project # This will run the tests when a push to master is detected, and will stop that if the tests fail # Save this as .git/hooks/pre-push and make it executable protected_branch='master' # Git gives us lines like "refs/heads/frombranch SOMESHA1 refs/heads/tobranch SOMESHA1" # We're only interested in the branches while read from _ to _; do if [ "x$to" = "xrefs/heads/$protected_branch" ]; then isprotected=1 fi done if [ "x$isprotected" = x1 ]; then echo "Running tests before push to master" make test RESULT=$? if [ $RESULT -ne 0 ]; then echo "Tests failed for a push to master, we can't let you do that" >&2 exit 1 fi fi exit 0 ``` This will check if the push is to the master branch and, if it is, only allow the push if running `make test` succeeds. In some circumstances it may be advisable to circumvent this check with `git push --no-verify`, but usually that isn't necessary. To install the hook, place the code in a new file `.git/hooks/pre-push` and make it executable. ### Coverity Scan We use Coverity's static analysis tool which offers free access to open source projects. While access to the tool itself is restricted, fish-shell organization members should know that they can login [here](https://scan.coverity.com/projects/fish-shell-fish-shell?tab=overview) with their GitHub account. Currently, tests are triggered upon merging the `master` branch into `coverity_scan_master`. Even if you are not a fish developer, you can keep an eye on our statistics there. ## Installing the Required Tools ### Installing the Linting Tools To install the lint checkers on Mac OS X using Homebrew: ``` brew tap oclint/formulae brew install oclint brew install cppcheck ``` To install the lint checkers on Debian-based Linux distributions: ``` sudo apt-get install clang sudo apt-get install oclint sudo apt-get install cppcheck ``` ### Installing the Reformatting Tools Mac OS X: ``` brew install clang-format ``` Debian-based: ``` apt-cache search clang-format ``` Above will list all the versions available. Pick the newest one available (3.9 for Ubuntu 16.10 as I write this) and install it: ``` sudo apt-get install clang-format-3.9 sudo ln -s /usr/bin/clang-format-3.9 /usr/bin/clang-format ``` ## Message Translations Fish uses the GNU gettext library to translate messages from English to other languages. All non-debug messages output for user consumption should be marked for translation. In C++, this requires the use of the `_` (underscore) macro: ``` streams.out.append_format(_(L"%ls: There are no jobs\n"), argv[0]); ``` All messages in fish script must be enclosed in single or double quote characters. They must also be translated via a subcommand. This means that the following are **not** valid: ``` echo (_ hello) _ "goodbye" ``` Above should be written like this instead: ``` echo (_ "hello") echo (_ "goodbye") ``` Note that you can use either single or double quotes to enclose the message to be translated. You can also optionally include spaces after the opening parentheses and once again before the closing parentheses. Creating and updating translations requires the Gettext tools, including `xgettext`, `msgfmt` and `msgmerge`. Translation sources are stored in the `po` directory, named `LANG.po`, where `LANG` is the two letter ISO 639-1 language code of the target language (eg `de` for German). To create a new translation, for example for German: * generate a `messages.pot` file by running `build_tools/fish_xgettext.fish` from the source tree * copy `messages.pot` to `po/LANG.po` () To update a translation: * generate a `messages.pot` file by running `build_tools/fish_xgettext.fish` from the source tree * update the existing translation by running `msgmerge --update --no-fuzzy-matching po/LANG.po messages.pot` Many tools are available for editing translation files, including command-line and graphical user interface programs. Be cautious about blindly updating an existing translation file. Trivial changes to an existing message (eg changing the punctuation) will cause existing translations to be removed, since the tools do literal string matching. Therefore, in general, you need to carefully review any recommended deletions. Read the [translations wiki](https://github.com/fish-shell/fish-shell/wiki/Translations) for more information. fish-3.1.0/COPYING000066400000000000000000000014641362100272700135040ustar00rootroot00000000000000Fish is a smart and user-friendly command line shell. Copyright (C) 2005-2009 Axel Liljencrantz Copyright (C) 2009-2019 fish-shell contributors fish is free software. Most of fish is licensed under the GNU General Public License version 2, and you can redistribute it and/or modify it under the terms of the GNU GPL as published by the Free Software Foundation. fish also includes software licensed under the GNU Lesser General Public License version 2, the OpenBSD license, the ISC license, and the NetBSD license. Full licensing information is contained in doc_src/license.hdr. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. fish-3.1.0/Dockerfile000066400000000000000000000004671362100272700144450ustar00rootroot00000000000000FROM centos:latest # Build dependency RUN yum update -y &&\ yum install -y epel-release &&\ yum install -y clang cmake3 gcc-c++ make ncurses-devel &&\ yum clean all # Test dependency RUN yum install -y expect vim-common ADD . /src WORKDIR /src # Build fish RUN cmake3 . &&\ make &&\ make install fish-3.1.0/GNUmakefile000066400000000000000000000030351362100272700145170ustar00rootroot00000000000000# This is a very basic `make` wrapper around the CMake build toolchain. # # Supported arguments: # PREFIX: sets the installation prefix # GENERATOR: explicitly specifies the CMake generator to use CMAKE ?= cmake GENERATOR ?= $(shell (which ninja > /dev/null 2> /dev/null && echo Ninja) || \ echo 'Unix Makefiles') prefix ?= /usr/local PREFIX ?= $(prefix) ifeq ($(GENERATOR), Ninja) BUILDFILE = build.ninja else BUILDFILE = Makefile endif # If CMake has generated an in-tree Makefile, use that instead (issue #6264) MAKE_DIR:=$(shell dirname $(realpath $(firstword $(MAKEFILE_LIST)))) ifeq ($(shell test -f $(MAKE_DIR)/Makefile && echo 1), 1) all: @+$(MAKE) -f $(MAKE_DIR)/Makefile $(MAKECMDGOALS) --no-print-directory %: @+$(MAKE) -f $(MAKE_DIR)/Makefile $(MAKECMDGOALS) --no-print-directory else all: .begin build/fish PHONY: .begin .begin: @which $(CMAKE) > /dev/null 2> /dev/null || \ (echo 'Please install CMake and then re-run the `make` command!' 1>&2 && false) build/fish: build/$(BUILDFILE) $(CMAKE) --build build build/$(BUILDFILE): build cd build; $(CMAKE) .. -DCMAKE_EXPORT_COMPILE_COMMANDS=1 -G "$(GENERATOR)" \ -DCMAKE_INSTALL_PREFIX="$(PREFIX)" -DCMAKE_EXPORT_COMPILE_COMMANDS=1 build: mkdir -p build .PHONY: clean clean: rm -rf build .PHONY: test test: build/fish $(CMAKE) --build build --target test .PHONY: install install: build/fish $(CMAKE) --build build --target install .PHONY: run run: build/fish ./build/fish || true .PHONY: exec exec: build/fish exec ./build/fish endif # CMake in-tree build check fish-3.1.0/README.md000066400000000000000000000150261362100272700137270ustar00rootroot00000000000000[fish](https://fishshell.com/) - the friendly interactive shell [![Build Status](https://travis-ci.org/fish-shell/fish-shell.svg?branch=master)](https://travis-ci.org/fish-shell/fish-shell) ================================================ fish is a smart and user-friendly command line shell for macOS, Linux, and the rest of the family. fish includes features like syntax highlighting, autosuggest-as-you-type, and fancy tab completions that just work, with no configuration required. For more on fish's design philosophy, see the [design document](https://fishshell.com/docs/current/design.html). ## Quick Start fish generally works like other shells, like bash or zsh. A few important differences can be found at by searching for the magic phrase "unlike other shells". Detailed user documentation is available by running `help` within fish, and also at You can quickly play with fish right in your browser by clicking the button below: [![Try in browser](https://cdn.rawgit.com/rootnroll/library/assets/try.svg)](https://rootnroll.com/d/fish-shell/) ## Getting fish ### macOS fish can be installed: * using [Homebrew](http://brew.sh/): `brew install fish` * using [MacPorts](https://www.macports.org/): `sudo port install fish` * using the [installer from fishshell.com](https://fishshell.com/) * as a [standalone app from fishshell.com](https://fishshell.com/) ### Packages for Linux Packages for Debian, Fedora, openSUSE, and Red Hat Enterprise Linux/CentOS are available from the [openSUSE Build Service](https://software.opensuse.org/download.html?project=shells%3Afish&package=fish). Packages for Ubuntu are available from the [fish PPA](https://launchpad.net/~fish-shell/+archive/ubuntu/release-3), and can be installed using the following commands: ``` sudo apt-add-repository ppa:fish-shell/release-3 sudo apt-get update sudo apt-get install fish ``` Instructions for other distributions may be found at [fishshell.com](https://fishshell.com). ### Windows - On Windows 10, fish can be installed under the WSL Windows Subsystem for Linux with `sudo apt install fish` or from source with the instructions below. - Fish can also be installed on all versions of Windows using [Cygwin](https://cygwin.com/) (from the **Shells** category). ### Building from source If packages are not available for your platform, GPG-signed tarballs are available from [fishshell.com](https://fishshell.com/) and [fish-shell on GitHub](https://github.com/fish-shell/fish-shell/releases). See the *Building* section for instructions. ## Running fish Once installed, run `fish` from your current shell to try fish out! ### Dependencies Running fish requires: * curses or ncurses (preinstalled on most \*nix systems) * some common \*nix system utilities (currently `mktemp`), in addition to the basic POSIX utilities (`cat`, `cut`, `dirname`, `ls`, `mkdir`, `mkfifo`, `rm`, `sort`, `tee`, `tr`, `uname` and `sed` at least, but the full coreutils plus find, sed and awk is preferred) * gettext (library and `gettext` command), if compiled with translation support The following optional features also have specific requirements: * builtin commands that have the `--help` option or print usage messages require `ul` and either `nroff` or `mandoc` for display * automated completion generation from manual pages requires Python (2.7+ or 3.3+) and possibly the `backports.lzma` module for Python 2.7 * the `fish_config` web configuration tool requires Python (2.7+ or 3.3 +) and a web browser * system clipboard integration (with the default Ctrl-V and Ctrl-X bindings) require either the `xsel`, `xclip`, `wl-copy`/`wl-paste` or `pbcopy`/`pbpaste` utilities * full completions for `yarn` and `npm` require the `all-the-package-names` NPM module ### Switching to fish If you wish to use fish as your default shell, use the following command: chsh -s /usr/local/bin/fish `chsh` will prompt you for your password and change your default shell. (Substitute `/usr/local/bin/fish` with whatever path fish was installed to, if it differs.) Log out, then log in again for the changes to take effect. Use the following command if fish isn't already added to `/etc/shells` to permit fish to be your login shell: echo /usr/local/bin/fish | sudo tee -a /etc/shells To switch your default shell back, you can run `chsh -s /bin/bash` (substituting `/bin/bash` with `/bin/tcsh` or `/bin/zsh` as appropriate). ## Building ### Dependencies Compiling fish requires: * a C++11 compiler (g++ 4.8 or later, or clang 3.3 or later) * CMake (version 3.2 or later) * a curses implementation such as ncurses (headers and libraries) * PCRE2 (headers and libraries) - a copy is included with fish * gettext (headers and libraries) - optional, for translation support Sphinx is also optionally required to build the documentation from a cloned git repository. ### Building from source (all platforms) - Makefile generator To install into `/usr/local`, run: ```bash mkdir build; cd build cmake .. make sudo make install ``` The install directory can be changed using the `-DCMAKE_INSTALL_PREFIX` parameter for `cmake`. ### Building from source (macOS) - Xcode ```bash mkdir build; cd build cmake .. -G Xcode ``` An Xcode project will now be available in the `build` subdirectory. You can open it with Xcode, or run the following to build and install in `/usr/local`: ```bash xcodebuild xcodebuild -scheme install ``` The install directory can be changed using the `-DCMAKE_INSTALL_PREFIX` parameter for `cmake`. ### Help, it didn't build! If fish reports that it could not find curses, try installing a curses development package and build again. On Debian or Ubuntu you want: sudo apt-get install build-essential cmake ncurses-dev libncurses5-dev libpcre2-dev gettext On RedHat, CentOS, or Amazon EC2: sudo yum install ncurses-devel ## Contributing Changes to the Code See the [Guide for Developers](CONTRIBUTING.md). ## Contact Us Questions, comments, rants and raves can be posted to the official fish mailing list at or join us on our [gitter.im channel](https://gitter.im/fish-shell/fish-shell). Or use the [fish tag on Stackoverflow](https://stackoverflow.com/questions/tagged/fish) for questions related to fish script and the [fish tag on Superuser](https://superuser.com/questions/tagged/fish) for all other questions (e.g., customizing colors, changing key bindings). Found a bug? Have an awesome idea? Please [open an issue](https://github.com/fish-shell/fish-shell/issues/new). fish-3.1.0/benchmarks/000077500000000000000000000000001362100272700145615ustar00rootroot00000000000000fish-3.1.0/benchmarks/benchmarks/000077500000000000000000000000001362100272700166765ustar00rootroot00000000000000fish-3.1.0/benchmarks/benchmarks/aliases.fish000066400000000000000000001136541362100272700212040ustar00rootroot00000000000000function alias --description 'Creates a function wrapping a command' set -l options 'h/help' 's/save' argparse -n alias --max-args=2 $options -- $argv or return if set -q _flag_help __fish_print_help alias return 0 end set -l name set -l body set -l prefix set -l first_word set -l wrapped_cmd if not set -q argv[1] # Print the known aliases. for func in (functions -n) set -l output (functions $func | string match -r -- "^function .* --description 'alias (.*)'") if set -q output[2] set output (string replace -r -- '^'$func'[= ]' '' $output[2]) echo alias $func (string escape -- $output[1]) end end return 0 else if not set -q argv[2] # Alias definition of the form "name=value". set -l tmp (string split -m 1 "=" -- $argv) "" set name $tmp[1] set body $tmp[2] else # Alias definition of the form "name value". set name $argv[1] set body $argv[2] end # sanity check if test -z "$name" printf ( _ "%s: Name cannot be empty\n") alias return 1 else if test -z "$body" printf ( _ "%s: Body cannot be empty\n") alias return 1 end # Extract the first command from the body. printf '%s\n' $body | read -lt first_word body # Prevent the alias from immediately running into an infinite recursion if # $body starts with the same command as $name. if test $first_word = $name if contains $name (builtin --names) set prefix builtin else set prefix command end end set -l cmd_string (string escape -- "alias $argv") set wrapped_cmd (string join ' ' -- $first_word $body | string escape) echo "function $name --wraps $wrapped_cmd --description $cmd_string; $prefix $first_word $body \$argv; end" | source if set -q _flag_save funcsave $name end #echo "function $name --wraps $wrapped_cmd --description $cmd_string; $prefix $first_word $body \$argv; end" end alias alias0='something --arg0' alias alias1='something --arg1' alias alias2='something --arg2' alias alias3='something --arg3' alias alias4='something --arg4' alias alias5='something --arg5' alias alias6='something --arg6' alias alias7='something --arg7' alias alias8='something --arg8' alias alias9='something --arg9' alias alias10='something --arg10' alias alias11='something --arg11' alias alias12='something --arg12' alias alias13='something --arg13' alias alias14='something --arg14' alias alias15='something --arg15' alias alias16='something --arg16' alias alias17='something --arg17' alias alias18='something --arg18' alias alias19='something --arg19' alias alias20='something --arg20' alias alias21='something --arg21' alias alias22='something --arg22' alias alias23='something --arg23' alias alias24='something --arg24' alias alias25='something --arg25' alias alias26='something --arg26' alias alias27='something --arg27' alias alias28='something --arg28' alias alias29='something --arg29' alias alias30='something --arg30' alias alias31='something --arg31' alias alias32='something --arg32' alias alias33='something --arg33' alias alias34='something --arg34' alias alias35='something --arg35' alias alias36='something --arg36' alias alias37='something --arg37' alias alias38='something --arg38' alias alias39='something --arg39' alias alias40='something --arg40' alias alias41='something --arg41' alias alias42='something --arg42' alias alias43='something --arg43' alias alias44='something --arg44' alias alias45='something --arg45' alias alias46='something --arg46' alias alias47='something --arg47' alias alias48='something --arg48' alias alias49='something --arg49' alias alias50='something --arg50' alias alias51='something --arg51' alias alias52='something --arg52' alias alias53='something --arg53' alias alias54='something --arg54' alias alias55='something --arg55' alias alias56='something --arg56' alias alias57='something --arg57' alias alias58='something --arg58' alias alias59='something --arg59' alias alias60='something --arg60' alias alias61='something --arg61' alias alias62='something --arg62' alias alias63='something --arg63' alias alias64='something --arg64' alias alias65='something --arg65' alias alias66='something --arg66' alias alias67='something --arg67' alias alias68='something --arg68' alias alias69='something --arg69' alias alias70='something --arg70' alias alias71='something --arg71' alias alias72='something --arg72' alias alias73='something --arg73' alias alias74='something --arg74' alias alias75='something --arg75' alias alias76='something --arg76' alias alias77='something --arg77' alias alias78='something --arg78' alias alias79='something --arg79' alias alias80='something --arg80' alias alias81='something --arg81' alias alias82='something --arg82' alias alias83='something --arg83' alias alias84='something --arg84' alias alias85='something --arg85' alias alias86='something --arg86' alias alias87='something --arg87' alias alias88='something --arg88' alias alias89='something --arg89' alias alias90='something --arg90' alias alias91='something --arg91' alias alias92='something --arg92' alias alias93='something --arg93' alias alias94='something --arg94' alias alias95='something --arg95' alias alias96='something --arg96' alias alias97='something --arg97' alias alias98='something --arg98' alias alias99='something --arg99' alias alias100='something --arg100' alias alias101='something --arg101' alias alias102='something --arg102' alias alias103='something --arg103' alias alias104='something --arg104' alias alias105='something --arg105' alias alias106='something --arg106' alias alias107='something --arg107' alias alias108='something --arg108' alias alias109='something --arg109' alias alias110='something --arg110' alias alias111='something --arg111' alias alias112='something --arg112' alias alias113='something --arg113' alias alias114='something --arg114' alias alias115='something --arg115' alias alias116='something --arg116' alias alias117='something --arg117' alias alias118='something --arg118' alias alias119='something --arg119' alias alias120='something --arg120' alias alias121='something --arg121' alias alias122='something --arg122' alias alias123='something --arg123' alias alias124='something --arg124' alias alias125='something --arg125' alias alias126='something --arg126' alias alias127='something --arg127' alias alias128='something --arg128' alias alias129='something --arg129' alias alias130='something --arg130' alias alias131='something --arg131' alias alias132='something --arg132' alias alias133='something --arg133' alias alias134='something --arg134' alias alias135='something --arg135' alias alias136='something --arg136' alias alias137='something --arg137' alias alias138='something --arg138' alias alias139='something --arg139' alias alias140='something --arg140' alias alias141='something --arg141' alias alias142='something --arg142' alias alias143='something --arg143' alias alias144='something --arg144' alias alias145='something --arg145' alias alias146='something --arg146' alias alias147='something --arg147' alias alias148='something --arg148' alias alias149='something --arg149' alias alias150='something --arg150' alias alias151='something --arg151' alias alias152='something --arg152' alias alias153='something --arg153' alias alias154='something --arg154' alias alias155='something --arg155' alias alias156='something --arg156' alias alias157='something --arg157' alias alias158='something --arg158' alias alias159='something --arg159' alias alias160='something --arg160' alias alias161='something --arg161' alias alias162='something --arg162' alias alias163='something --arg163' alias alias164='something --arg164' alias alias165='something --arg165' alias alias166='something --arg166' alias alias167='something --arg167' alias alias168='something --arg168' alias alias169='something --arg169' alias alias170='something --arg170' alias alias171='something --arg171' alias alias172='something --arg172' alias alias173='something --arg173' alias alias174='something --arg174' alias alias175='something --arg175' alias alias176='something --arg176' alias alias177='something --arg177' alias alias178='something --arg178' alias alias179='something --arg179' alias alias180='something --arg180' alias alias181='something --arg181' alias alias182='something --arg182' alias alias183='something --arg183' alias alias184='something --arg184' alias alias185='something --arg185' alias alias186='something --arg186' alias alias187='something --arg187' alias alias188='something --arg188' alias alias189='something --arg189' alias alias190='something --arg190' alias alias191='something --arg191' alias alias192='something --arg192' alias alias193='something --arg193' alias alias194='something --arg194' alias alias195='something --arg195' alias alias196='something --arg196' alias alias197='something --arg197' alias alias198='something --arg198' alias alias199='something --arg199' alias alias200='something --arg200' alias alias201='something --arg201' alias alias202='something --arg202' alias alias203='something --arg203' alias alias204='something --arg204' alias alias205='something --arg205' alias alias206='something --arg206' alias alias207='something --arg207' alias alias208='something --arg208' alias alias209='something --arg209' alias alias210='something --arg210' alias alias211='something --arg211' alias alias212='something --arg212' alias alias213='something --arg213' alias alias214='something --arg214' alias alias215='something --arg215' alias alias216='something --arg216' alias alias217='something --arg217' alias alias218='something --arg218' alias alias219='something --arg219' alias alias220='something --arg220' alias alias221='something --arg221' alias alias222='something --arg222' alias alias223='something --arg223' alias alias224='something --arg224' alias alias225='something --arg225' alias alias226='something --arg226' alias alias227='something --arg227' alias alias228='something --arg228' alias alias229='something --arg229' alias alias230='something --arg230' alias alias231='something --arg231' alias alias232='something --arg232' alias alias233='something --arg233' alias alias234='something --arg234' alias alias235='something --arg235' alias alias236='something --arg236' alias alias237='something --arg237' alias alias238='something --arg238' alias alias239='something --arg239' alias alias240='something --arg240' alias alias241='something --arg241' alias alias242='something --arg242' alias alias243='something --arg243' alias alias244='something --arg244' alias alias245='something --arg245' alias alias246='something --arg246' alias alias247='something --arg247' alias alias248='something --arg248' alias alias249='something --arg249' alias alias250='something --arg250' alias alias251='something --arg251' alias alias252='something --arg252' alias alias253='something --arg253' alias alias254='something --arg254' alias alias255='something --arg255' alias alias256='something --arg256' alias alias257='something --arg257' alias alias258='something --arg258' alias alias259='something --arg259' alias alias260='something --arg260' alias alias261='something --arg261' alias alias262='something --arg262' alias alias263='something --arg263' alias alias264='something --arg264' alias alias265='something --arg265' alias alias266='something --arg266' alias alias267='something --arg267' alias alias268='something --arg268' alias alias269='something --arg269' alias alias270='something --arg270' alias alias271='something --arg271' alias alias272='something --arg272' alias alias273='something --arg273' alias alias274='something --arg274' alias alias275='something --arg275' alias alias276='something --arg276' alias alias277='something --arg277' alias alias278='something --arg278' alias alias279='something --arg279' alias alias280='something --arg280' alias alias281='something --arg281' alias alias282='something --arg282' alias alias283='something --arg283' alias alias284='something --arg284' alias alias285='something --arg285' alias alias286='something --arg286' alias alias287='something --arg287' alias alias288='something --arg288' alias alias289='something --arg289' alias alias290='something --arg290' alias alias291='something --arg291' alias alias292='something --arg292' alias alias293='something --arg293' alias alias294='something --arg294' alias alias295='something --arg295' alias alias296='something --arg296' alias alias297='something --arg297' alias alias298='something --arg298' alias alias299='something --arg299' alias alias300='something --arg300' alias alias301='something --arg301' alias alias302='something --arg302' alias alias303='something --arg303' alias alias304='something --arg304' alias alias305='something --arg305' alias alias306='something --arg306' alias alias307='something --arg307' alias alias308='something --arg308' alias alias309='something --arg309' alias alias310='something --arg310' alias alias311='something --arg311' alias alias312='something --arg312' alias alias313='something --arg313' alias alias314='something --arg314' alias alias315='something --arg315' alias alias316='something --arg316' alias alias317='something --arg317' alias alias318='something --arg318' alias alias319='something --arg319' alias alias320='something --arg320' alias alias321='something --arg321' alias alias322='something --arg322' alias alias323='something --arg323' alias alias324='something --arg324' alias alias325='something --arg325' alias alias326='something --arg326' alias alias327='something --arg327' alias alias328='something --arg328' alias alias329='something --arg329' alias alias330='something --arg330' alias alias331='something --arg331' alias alias332='something --arg332' alias alias333='something --arg333' alias alias334='something --arg334' alias alias335='something --arg335' alias alias336='something --arg336' alias alias337='something --arg337' alias alias338='something --arg338' alias alias339='something --arg339' alias alias340='something --arg340' alias alias341='something --arg341' alias alias342='something --arg342' alias alias343='something --arg343' alias alias344='something --arg344' alias alias345='something --arg345' alias alias346='something --arg346' alias alias347='something --arg347' alias alias348='something --arg348' alias alias349='something --arg349' alias alias350='something --arg350' alias alias351='something --arg351' alias alias352='something --arg352' alias alias353='something --arg353' alias alias354='something --arg354' alias alias355='something --arg355' alias alias356='something --arg356' alias alias357='something --arg357' alias alias358='something --arg358' alias alias359='something --arg359' alias alias360='something --arg360' alias alias361='something --arg361' alias alias362='something --arg362' alias alias363='something --arg363' alias alias364='something --arg364' alias alias365='something --arg365' alias alias366='something --arg366' alias alias367='something --arg367' alias alias368='something --arg368' alias alias369='something --arg369' alias alias370='something --arg370' alias alias371='something --arg371' alias alias372='something --arg372' alias alias373='something --arg373' alias alias374='something --arg374' alias alias375='something --arg375' alias alias376='something --arg376' alias alias377='something --arg377' alias alias378='something --arg378' alias alias379='something --arg379' alias alias380='something --arg380' alias alias381='something --arg381' alias alias382='something --arg382' alias alias383='something --arg383' alias alias384='something --arg384' alias alias385='something --arg385' alias alias386='something --arg386' alias alias387='something --arg387' alias alias388='something --arg388' alias alias389='something --arg389' alias alias390='something --arg390' alias alias391='something --arg391' alias alias392='something --arg392' alias alias393='something --arg393' alias alias394='something --arg394' alias alias395='something --arg395' alias alias396='something --arg396' alias alias397='something --arg397' alias alias398='something --arg398' alias alias399='something --arg399' alias alias400='something --arg400' alias alias401='something --arg401' alias alias402='something --arg402' alias alias403='something --arg403' alias alias404='something --arg404' alias alias405='something --arg405' alias alias406='something --arg406' alias alias407='something --arg407' alias alias408='something --arg408' alias alias409='something --arg409' alias alias410='something --arg410' alias alias411='something --arg411' alias alias412='something --arg412' alias alias413='something --arg413' alias alias414='something --arg414' alias alias415='something --arg415' alias alias416='something --arg416' alias alias417='something --arg417' alias alias418='something --arg418' alias alias419='something --arg419' alias alias420='something --arg420' alias alias421='something --arg421' alias alias422='something --arg422' alias alias423='something --arg423' alias alias424='something --arg424' alias alias425='something --arg425' alias alias426='something --arg426' alias alias427='something --arg427' alias alias428='something --arg428' alias alias429='something --arg429' alias alias430='something --arg430' alias alias431='something --arg431' alias alias432='something --arg432' alias alias433='something --arg433' alias alias434='something --arg434' alias alias435='something --arg435' alias alias436='something --arg436' alias alias437='something --arg437' alias alias438='something --arg438' alias alias439='something --arg439' alias alias440='something --arg440' alias alias441='something --arg441' alias alias442='something --arg442' alias alias443='something --arg443' alias alias444='something --arg444' alias alias445='something --arg445' alias alias446='something --arg446' alias alias447='something --arg447' alias alias448='something --arg448' alias alias449='something --arg449' alias alias450='something --arg450' alias alias451='something --arg451' alias alias452='something --arg452' alias alias453='something --arg453' alias alias454='something --arg454' alias alias455='something --arg455' alias alias456='something --arg456' alias alias457='something --arg457' alias alias458='something --arg458' alias alias459='something --arg459' alias alias460='something --arg460' alias alias461='something --arg461' alias alias462='something --arg462' alias alias463='something --arg463' alias alias464='something --arg464' alias alias465='something --arg465' alias alias466='something --arg466' alias alias467='something --arg467' alias alias468='something --arg468' alias alias469='something --arg469' alias alias470='something --arg470' alias alias471='something --arg471' alias alias472='something --arg472' alias alias473='something --arg473' alias alias474='something --arg474' alias alias475='something --arg475' alias alias476='something --arg476' alias alias477='something --arg477' alias alias478='something --arg478' alias alias479='something --arg479' alias alias480='something --arg480' alias alias481='something --arg481' alias alias482='something --arg482' alias alias483='something --arg483' alias alias484='something --arg484' alias alias485='something --arg485' alias alias486='something --arg486' alias alias487='something --arg487' alias alias488='something --arg488' alias alias489='something --arg489' alias alias490='something --arg490' alias alias491='something --arg491' alias alias492='something --arg492' alias alias493='something --arg493' alias alias494='something --arg494' alias alias495='something --arg495' alias alias496='something --arg496' alias alias497='something --arg497' alias alias498='something --arg498' alias alias499='something --arg499' alias alias500='something --arg500' alias alias501='something --arg501' alias alias502='something --arg502' alias alias503='something --arg503' alias alias504='something --arg504' alias alias505='something --arg505' alias alias506='something --arg506' alias alias507='something --arg507' alias alias508='something --arg508' alias alias509='something --arg509' alias alias510='something --arg510' alias alias511='something --arg511' alias alias512='something --arg512' alias alias513='something --arg513' alias alias514='something --arg514' alias alias515='something --arg515' alias alias516='something --arg516' alias alias517='something --arg517' alias alias518='something --arg518' alias alias519='something --arg519' alias alias520='something --arg520' alias alias521='something --arg521' alias alias522='something --arg522' alias alias523='something --arg523' alias alias524='something --arg524' alias alias525='something --arg525' alias alias526='something --arg526' alias alias527='something --arg527' alias alias528='something --arg528' alias alias529='something --arg529' alias alias530='something --arg530' alias alias531='something --arg531' alias alias532='something --arg532' alias alias533='something --arg533' alias alias534='something --arg534' alias alias535='something --arg535' alias alias536='something --arg536' alias alias537='something --arg537' alias alias538='something --arg538' alias alias539='something --arg539' alias alias540='something --arg540' alias alias541='something --arg541' alias alias542='something --arg542' alias alias543='something --arg543' alias alias544='something --arg544' alias alias545='something --arg545' alias alias546='something --arg546' alias alias547='something --arg547' alias alias548='something --arg548' alias alias549='something --arg549' alias alias550='something --arg550' alias alias551='something --arg551' alias alias552='something --arg552' alias alias553='something --arg553' alias alias554='something --arg554' alias alias555='something --arg555' alias alias556='something --arg556' alias alias557='something --arg557' alias alias558='something --arg558' alias alias559='something --arg559' alias alias560='something --arg560' alias alias561='something --arg561' alias alias562='something --arg562' alias alias563='something --arg563' alias alias564='something --arg564' alias alias565='something --arg565' alias alias566='something --arg566' alias alias567='something --arg567' alias alias568='something --arg568' alias alias569='something --arg569' alias alias570='something --arg570' alias alias571='something --arg571' alias alias572='something --arg572' alias alias573='something --arg573' alias alias574='something --arg574' alias alias575='something --arg575' alias alias576='something --arg576' alias alias577='something --arg577' alias alias578='something --arg578' alias alias579='something --arg579' alias alias580='something --arg580' alias alias581='something --arg581' alias alias582='something --arg582' alias alias583='something --arg583' alias alias584='something --arg584' alias alias585='something --arg585' alias alias586='something --arg586' alias alias587='something --arg587' alias alias588='something --arg588' alias alias589='something --arg589' alias alias590='something --arg590' alias alias591='something --arg591' alias alias592='something --arg592' alias alias593='something --arg593' alias alias594='something --arg594' alias alias595='something --arg595' alias alias596='something --arg596' alias alias597='something --arg597' alias alias598='something --arg598' alias alias599='something --arg599' alias alias600='something --arg600' alias alias601='something --arg601' alias alias602='something --arg602' alias alias603='something --arg603' alias alias604='something --arg604' alias alias605='something --arg605' alias alias606='something --arg606' alias alias607='something --arg607' alias alias608='something --arg608' alias alias609='something --arg609' alias alias610='something --arg610' alias alias611='something --arg611' alias alias612='something --arg612' alias alias613='something --arg613' alias alias614='something --arg614' alias alias615='something --arg615' alias alias616='something --arg616' alias alias617='something --arg617' alias alias618='something --arg618' alias alias619='something --arg619' alias alias620='something --arg620' alias alias621='something --arg621' alias alias622='something --arg622' alias alias623='something --arg623' alias alias624='something --arg624' alias alias625='something --arg625' alias alias626='something --arg626' alias alias627='something --arg627' alias alias628='something --arg628' alias alias629='something --arg629' alias alias630='something --arg630' alias alias631='something --arg631' alias alias632='something --arg632' alias alias633='something --arg633' alias alias634='something --arg634' alias alias635='something --arg635' alias alias636='something --arg636' alias alias637='something --arg637' alias alias638='something --arg638' alias alias639='something --arg639' alias alias640='something --arg640' alias alias641='something --arg641' alias alias642='something --arg642' alias alias643='something --arg643' alias alias644='something --arg644' alias alias645='something --arg645' alias alias646='something --arg646' alias alias647='something --arg647' alias alias648='something --arg648' alias alias649='something --arg649' alias alias650='something --arg650' alias alias651='something --arg651' alias alias652='something --arg652' alias alias653='something --arg653' alias alias654='something --arg654' alias alias655='something --arg655' alias alias656='something --arg656' alias alias657='something --arg657' alias alias658='something --arg658' alias alias659='something --arg659' alias alias660='something --arg660' alias alias661='something --arg661' alias alias662='something --arg662' alias alias663='something --arg663' alias alias664='something --arg664' alias alias665='something --arg665' alias alias666='something --arg666' alias alias667='something --arg667' alias alias668='something --arg668' alias alias669='something --arg669' alias alias670='something --arg670' alias alias671='something --arg671' alias alias672='something --arg672' alias alias673='something --arg673' alias alias674='something --arg674' alias alias675='something --arg675' alias alias676='something --arg676' alias alias677='something --arg677' alias alias678='something --arg678' alias alias679='something --arg679' alias alias680='something --arg680' alias alias681='something --arg681' alias alias682='something --arg682' alias alias683='something --arg683' alias alias684='something --arg684' alias alias685='something --arg685' alias alias686='something --arg686' alias alias687='something --arg687' alias alias688='something --arg688' alias alias689='something --arg689' alias alias690='something --arg690' alias alias691='something --arg691' alias alias692='something --arg692' alias alias693='something --arg693' alias alias694='something --arg694' alias alias695='something --arg695' alias alias696='something --arg696' alias alias697='something --arg697' alias alias698='something --arg698' alias alias699='something --arg699' alias alias700='something --arg700' alias alias701='something --arg701' alias alias702='something --arg702' alias alias703='something --arg703' alias alias704='something --arg704' alias alias705='something --arg705' alias alias706='something --arg706' alias alias707='something --arg707' alias alias708='something --arg708' alias alias709='something --arg709' alias alias710='something --arg710' alias alias711='something --arg711' alias alias712='something --arg712' alias alias713='something --arg713' alias alias714='something --arg714' alias alias715='something --arg715' alias alias716='something --arg716' alias alias717='something --arg717' alias alias718='something --arg718' alias alias719='something --arg719' alias alias720='something --arg720' alias alias721='something --arg721' alias alias722='something --arg722' alias alias723='something --arg723' alias alias724='something --arg724' alias alias725='something --arg725' alias alias726='something --arg726' alias alias727='something --arg727' alias alias728='something --arg728' alias alias729='something --arg729' alias alias730='something --arg730' alias alias731='something --arg731' alias alias732='something --arg732' alias alias733='something --arg733' alias alias734='something --arg734' alias alias735='something --arg735' alias alias736='something --arg736' alias alias737='something --arg737' alias alias738='something --arg738' alias alias739='something --arg739' alias alias740='something --arg740' alias alias741='something --arg741' alias alias742='something --arg742' alias alias743='something --arg743' alias alias744='something --arg744' alias alias745='something --arg745' alias alias746='something --arg746' alias alias747='something --arg747' alias alias748='something --arg748' alias alias749='something --arg749' alias alias750='something --arg750' alias alias751='something --arg751' alias alias752='something --arg752' alias alias753='something --arg753' alias alias754='something --arg754' alias alias755='something --arg755' alias alias756='something --arg756' alias alias757='something --arg757' alias alias758='something --arg758' alias alias759='something --arg759' alias alias760='something --arg760' alias alias761='something --arg761' alias alias762='something --arg762' alias alias763='something --arg763' alias alias764='something --arg764' alias alias765='something --arg765' alias alias766='something --arg766' alias alias767='something --arg767' alias alias768='something --arg768' alias alias769='something --arg769' alias alias770='something --arg770' alias alias771='something --arg771' alias alias772='something --arg772' alias alias773='something --arg773' alias alias774='something --arg774' alias alias775='something --arg775' alias alias776='something --arg776' alias alias777='something --arg777' alias alias778='something --arg778' alias alias779='something --arg779' alias alias780='something --arg780' alias alias781='something --arg781' alias alias782='something --arg782' alias alias783='something --arg783' alias alias784='something --arg784' alias alias785='something --arg785' alias alias786='something --arg786' alias alias787='something --arg787' alias alias788='something --arg788' alias alias789='something --arg789' alias alias790='something --arg790' alias alias791='something --arg791' alias alias792='something --arg792' alias alias793='something --arg793' alias alias794='something --arg794' alias alias795='something --arg795' alias alias796='something --arg796' alias alias797='something --arg797' alias alias798='something --arg798' alias alias799='something --arg799' alias alias800='something --arg800' alias alias801='something --arg801' alias alias802='something --arg802' alias alias803='something --arg803' alias alias804='something --arg804' alias alias805='something --arg805' alias alias806='something --arg806' alias alias807='something --arg807' alias alias808='something --arg808' alias alias809='something --arg809' alias alias810='something --arg810' alias alias811='something --arg811' alias alias812='something --arg812' alias alias813='something --arg813' alias alias814='something --arg814' alias alias815='something --arg815' alias alias816='something --arg816' alias alias817='something --arg817' alias alias818='something --arg818' alias alias819='something --arg819' alias alias820='something --arg820' alias alias821='something --arg821' alias alias822='something --arg822' alias alias823='something --arg823' alias alias824='something --arg824' alias alias825='something --arg825' alias alias826='something --arg826' alias alias827='something --arg827' alias alias828='something --arg828' alias alias829='something --arg829' alias alias830='something --arg830' alias alias831='something --arg831' alias alias832='something --arg832' alias alias833='something --arg833' alias alias834='something --arg834' alias alias835='something --arg835' alias alias836='something --arg836' alias alias837='something --arg837' alias alias838='something --arg838' alias alias839='something --arg839' alias alias840='something --arg840' alias alias841='something --arg841' alias alias842='something --arg842' alias alias843='something --arg843' alias alias844='something --arg844' alias alias845='something --arg845' alias alias846='something --arg846' alias alias847='something --arg847' alias alias848='something --arg848' alias alias849='something --arg849' alias alias850='something --arg850' alias alias851='something --arg851' alias alias852='something --arg852' alias alias853='something --arg853' alias alias854='something --arg854' alias alias855='something --arg855' alias alias856='something --arg856' alias alias857='something --arg857' alias alias858='something --arg858' alias alias859='something --arg859' alias alias860='something --arg860' alias alias861='something --arg861' alias alias862='something --arg862' alias alias863='something --arg863' alias alias864='something --arg864' alias alias865='something --arg865' alias alias866='something --arg866' alias alias867='something --arg867' alias alias868='something --arg868' alias alias869='something --arg869' alias alias870='something --arg870' alias alias871='something --arg871' alias alias872='something --arg872' alias alias873='something --arg873' alias alias874='something --arg874' alias alias875='something --arg875' alias alias876='something --arg876' alias alias877='something --arg877' alias alias878='something --arg878' alias alias879='something --arg879' alias alias880='something --arg880' alias alias881='something --arg881' alias alias882='something --arg882' alias alias883='something --arg883' alias alias884='something --arg884' alias alias885='something --arg885' alias alias886='something --arg886' alias alias887='something --arg887' alias alias888='something --arg888' alias alias889='something --arg889' alias alias890='something --arg890' alias alias891='something --arg891' alias alias892='something --arg892' alias alias893='something --arg893' alias alias894='something --arg894' alias alias895='something --arg895' alias alias896='something --arg896' alias alias897='something --arg897' alias alias898='something --arg898' alias alias899='something --arg899' alias alias900='something --arg900' alias alias901='something --arg901' alias alias902='something --arg902' alias alias903='something --arg903' alias alias904='something --arg904' alias alias905='something --arg905' alias alias906='something --arg906' alias alias907='something --arg907' alias alias908='something --arg908' alias alias909='something --arg909' alias alias910='something --arg910' alias alias911='something --arg911' alias alias912='something --arg912' alias alias913='something --arg913' alias alias914='something --arg914' alias alias915='something --arg915' alias alias916='something --arg916' alias alias917='something --arg917' alias alias918='something --arg918' alias alias919='something --arg919' alias alias920='something --arg920' alias alias921='something --arg921' alias alias922='something --arg922' alias alias923='something --arg923' alias alias924='something --arg924' alias alias925='something --arg925' alias alias926='something --arg926' alias alias927='something --arg927' alias alias928='something --arg928' alias alias929='something --arg929' alias alias930='something --arg930' alias alias931='something --arg931' alias alias932='something --arg932' alias alias933='something --arg933' alias alias934='something --arg934' alias alias935='something --arg935' alias alias936='something --arg936' alias alias937='something --arg937' alias alias938='something --arg938' alias alias939='something --arg939' alias alias940='something --arg940' alias alias941='something --arg941' alias alias942='something --arg942' alias alias943='something --arg943' alias alias944='something --arg944' alias alias945='something --arg945' alias alias946='something --arg946' alias alias947='something --arg947' alias alias948='something --arg948' alias alias949='something --arg949' alias alias950='something --arg950' alias alias951='something --arg951' alias alias952='something --arg952' alias alias953='something --arg953' alias alias954='something --arg954' alias alias955='something --arg955' alias alias956='something --arg956' alias alias957='something --arg957' alias alias958='something --arg958' alias alias959='something --arg959' alias alias960='something --arg960' alias alias961='something --arg961' alias alias962='something --arg962' alias alias963='something --arg963' alias alias964='something --arg964' alias alias965='something --arg965' alias alias966='something --arg966' alias alias967='something --arg967' alias alias968='something --arg968' alias alias969='something --arg969' alias alias970='something --arg970' alias alias971='something --arg971' alias alias972='something --arg972' alias alias973='something --arg973' alias alias974='something --arg974' alias alias975='something --arg975' alias alias976='something --arg976' alias alias977='something --arg977' alias alias978='something --arg978' alias alias979='something --arg979' alias alias980='something --arg980' alias alias981='something --arg981' alias alias982='something --arg982' alias alias983='something --arg983' alias alias984='something --arg984' alias alias985='something --arg985' alias alias986='something --arg986' alias alias987='something --arg987' alias alias988='something --arg988' alias alias989='something --arg989' alias alias990='something --arg990' alias alias991='something --arg991' alias alias992='something --arg992' alias alias993='something --arg993' alias alias994='something --arg994' alias alias995='something --arg995' alias alias996='something --arg996' alias alias997='something --arg997' alias alias998='something --arg998' alias alias999='something --arg999' alias alias1000='something --arg1000' alias alias1001='something --arg1001' alias alias1002='something --arg1002' alias alias1003='something --arg1003' alias alias1004='something --arg1004' alias alias1005='something --arg1005' alias alias1006='something --arg1006' alias alias1007='something --arg1007' alias alias1008='something --arg1008' alias alias1009='something --arg1009' alias alias1010='something --arg1010' alias alias1011='something --arg1011' alias alias1012='something --arg1012' alias alias1013='something --arg1013' alias alias1014='something --arg1014' alias alias1015='something --arg1015' alias alias1016='something --arg1016' alias alias1017='something --arg1017' alias alias1018='something --arg1018' alias alias1019='something --arg1019' alias alias1020='something --arg1020' alias alias1021='something --arg1021' alias alias1022='something --arg1022' alias alias1023='something --arg1023' fish-3.1.0/benchmarks/benchmarks/external_cmds.fish000066400000000000000000000000521362100272700223760ustar00rootroot00000000000000for i in (seq 2000) command true end fish-3.1.0/benchmarks/benchmarks/seq_echo.fish000066400000000000000000000000441362100272700213350ustar00rootroot00000000000000for i in (seq 1000) echo $i end fish-3.1.0/benchmarks/driver.sh000077500000000000000000000006011362100272700164100ustar00rootroot00000000000000#!/bin/sh if [ "$#" -ne 1 ]; then echo "Usage: driver.sh /path/to/fish" fi FISH_PATH=$1 BENCHMARKS_DIR=$(dirname "$0")/benchmarks for benchmark in "$BENCHMARKS_DIR"/*; do basename "$benchmark" ${FISH_PATH} --print-rusage-self "$benchmark" > /dev/null if command -v hyperfine >/dev/null 2>&1; then hyperfine "${FISH_PATH} $benchmark > /dev/null" fi done fish-3.1.0/build_tools/000077500000000000000000000000001362100272700147635ustar00rootroot00000000000000fish-3.1.0/build_tools/cppcheck.sh000077500000000000000000000001101362100272700170720ustar00rootroot00000000000000#!/usr/local/bin/fish cppcheck --enable=all --std=posix --quiet ./src/ fish-3.1.0/build_tools/diff_profiles.fish000066400000000000000000000023251362100272700204530ustar00rootroot00000000000000#!/usr/bin/env fish # # Compares the output of two fish profile runs and emits the time difference between # the first and second set of results. # # Usage: ./diff_profiles.fish profile1.log profile2.log > profile_diff.log set profile1 (cat $argv[1]) set profile2 (cat $argv[2]) set line_no 0 while set next_line_no (math $line_no + 1) && set -q profile1[$next_line_no] && set -q profile2[$next_line_no] set line_no $next_line_no set line1 $profile1[$line_no] set line2 $profile2[$line_no] if not string match -qr '^\d+\t\d+' $line1 echo $line1 continue end set results1 (string match -r '^(\d+)\t(\d+)\s+(.*)' $line1) set results2 (string match -r '^(\d+)\t(\d+)\s+(.*)' $line2) # times from both files set time1 $results1[2..3] set time2 $results2[2..3] # leftover from both files set remainder1 $results1[4] set remainder2 $results2[4] if not string match -q -- $remainder1 $remainder2 echo Mismatch on line $line_no: echo - $remainder1 echo + $remainder2 exit 1 end set -l diff set diff[1] (math $time1[1] - $time2[1]) set diff[2] (math $time1[2] - $time2[2]) echo $diff[1] $diff[2] $remainder1 end fish-3.1.0/build_tools/find_globals.fish000077500000000000000000000066051362100272700202730ustar00rootroot00000000000000#!/usr/bin/env fish # Finds global variables by parsing the output of 'nm' # for object files in this directory. # This was written for macOS nm. set FISH_SOURCE_DIR $argv[1] if not test -d "$FISH_SOURCE_DIR" echo "FISH_SOURCE_DIR not given" exit 1 end set -g whitelist \ # unclear what this is \ l_constinit \ # hacks to work around missing ncurses strings on mac \ sitm_esc ritm_esc dim_esc \ # In our nm regex, we are interested in data (dD) and bss (bB) segments. set -g nm_regex '^([^ ]+) ([dDbB])' set total_globals 0 set boring_files \ fish_key_reader.cpp.o \ fish_tests.cpp.o \ fish_indent.cpp.o \ # return if we should ignore the given symbol name function should_ignore set symname $argv[1] string match -q '*guard variable for*' $symname and return 0 contains $symname $whitelist and return 0 return 1 end # echo a cleaned-up symbol name, e.g. replacing template gunk function cleanup_syname set symname $argv[1] set symname (string replace --all 'std::__1::basic_string, std::__1::allocator >' 'wcstring' $symname) set symname (string replace --all 'std::__1::vector >' 'wcstring_list_t' $symname) echo $symname end # Output the declaration for a symbol name in a given file. function print_decl set -l objfile $argv[1] set -l symname $argv[2] set -l varname (string split '::' $symname)[-1] set -l srcfile (basename $objfile .o) set -l srcpath $FISH_SOURCE_DIR/src/$srcfile # A leading underscore indicates a global, strip it. set varname (string replace --regex '^_' '' $varname) if not test -f "$srcpath" echo "Could not find $srcpath" end # Guess the variable as the first usage of the name. # Strip everything after the first =. set vardecl (egrep -m 1 " $varname\\b" $srcpath | cut -f -1 -d '=' | string trim) if test -z "$vardecl" echo "COULD_NOT_FIND_$varname" return 1 end echo $vardecl return 0 end # Return if a variable declaration is "thread safe". function decl_is_threadsafe set -l vardecl $argv[1] # decls starting with 'const ' or containing ' const ' are assumed safe. string match -q --regex '(^|\\*| )const ' $vardecl and return 0 # Ordinary types indicating a safe variable. set safes relaxed_atomic_bool_t std::mutex std::condition_variable std::once_flag sig_atomic_t for safe in $safes string match -q "*$safe*" $vardecl and return 0 end # Template types indicate a safe variable. set safes owning_lock mainthread_t std::atomic relaxed_atomic_t latch_t for safe in $safes string match -q "*$safe<*" $vardecl and return 0 end end for file in ./**.o set filename (basename $file) # Skip boring files. contains $filename $boring_files and continue for line in (nm -p -P -U $file | egrep $nm_regex) set matches (string match --regex $nm_regex -- $line) or continue set symname (cleanup_syname (echo $matches[2] | c++filt)) should_ignore $symname and continue set vardecl (print_decl $filename $symname) decl_is_threadsafe $vardecl and continue echo $filename $symname $matches[3] ":" $vardecl set total_globals (math $total_globals + 1) end end echo "Total: $total_globals" fish-3.1.0/build_tools/fish_xgettext.fish000077500000000000000000000056731362100272700205410ustar00rootroot00000000000000#!/usr/bin/env fish # # Tool to generate messages.pot # Extended to replace the old Makefile rule which did not port easily to CMak # This script was originally motivated to work around a quirk (or bug depending on your viewpoint) # of the xgettext command. See https://lists.gnu.org/archive/html/bug-gettext/2014-11/msg00006.html. # However, it turns out that even if that quirk did not exist we would still need something like # this script to properly extract descriptions. That's because we need to normalize the strings to # a format that xgettext will handle correctly. Also, `xgettext -LShell` doesn't correctly extract # all the strings we want translated. So we extract and normalize all such strings into a format # that `xgettext` can handle. # Start with the C++ source xgettext -k -k_ -kN_ -LC++ --no-wrap -o messages.pot src/*.cpp src/*.h # This regex handles descriptions for `complete` and `function` statements. These messages are not # particularly important to translate. Hence the "implicit" label. set implicit_regex '(?:^| +)(?:complete|function).*? (?:-d|--description) (([\'"]).+?(?/tmp/fish/explicit/$f.tmp ^/dev/null while read description echo 'N_ "'(string replace --all '"' '\\"' -- $description)'"' end /tmp/fish/explicit/$f rm /tmp/fish/explicit/$f.tmp # Handle `complete` / `function` description messages. The `| fish` is subtle. It basically # avoids the need to use `source` with a command substitution that could affect the current # shell. string replace --filter --regex $implicit_regex 'echo $1' <$f | fish >/tmp/fish/implicit/$f.tmp ^/dev/null while read description # We don't use `string escape` as shown in the next comment because it produces output that # is not parsed correctly by xgettext. Instead just escape double-quotes and quote the # resulting string. echo 'N_ "'(string replace --all '"' '\\"' -- $description)'"' end /tmp/fish/implicit/$f rm /tmp/fish/implicit/$f.tmp end xgettext -j -k -kN_ -LShell --from-code=UTF-8 -cDescription --no-wrap -o messages.pot /tmp/fish/explicit/share/*/*.fish xgettext -j -k -kN_ -LShell --from-code=UTF-8 -cDescription --no-wrap -o messages.pot /tmp/fish/implicit/share/*/*.fish rm -r /tmp/fish fish-3.1.0/build_tools/git_version_gen.sh000077500000000000000000000025301362100272700205030ustar00rootroot00000000000000#!/usr/bin/env sh # Originally from the git sources (GIT-VERSION-GEN) # Presumably (C) Junio C Hamano # Reused under GPL v2.0 # Modified for fish by David Adam set -e # Find the fish directory as two levels up from script directory. FISH_BASE_DIR="$( cd "$( dirname "$( dirname "$0" )" )" && pwd )" DEF_VER=unknown # First see if there is a version file (included in release tarballs), # then try git-describe, then default. if test -f version then VN=$(cat version) || VN="$DEF_VER" elif ! VN=$(git -C "$FISH_BASE_DIR" describe --always --dirty 2>/dev/null); then VN="$DEF_VER" fi # If the first param is --stdout, then output to stdout and exit. if test "$1" = '--stdout' then echo $VN exit 0 fi # Set the output directory as either the first param or cwd. test -n "$1" && OUTPUT_DIR=$1/ || OUTPUT_DIR= FBVF=${OUTPUT_DIR}FISH-BUILD-VERSION-FILE if test -r $FBVF then VC=$(grep -v '^#' $FBVF | tr -d '"' | sed -e 's/^FISH_BUILD_VERSION=//') else VC="unset" fi # Maybe output the FBVF # It looks like FISH_BUILD_VERSION="2.7.1-621-ga2f065e6" test "$VN" = "$VC" || { echo >&2 "FISH_BUILD_VERSION=$VN" echo "FISH_BUILD_VERSION=\"$VN\"" >${FBVF} } # Output the fish-build-version-witness.txt # See https://cmake.org/cmake/help/v3.4/policy/CMP0058.html date +%s > ${OUTPUT_DIR}fish-build-version-witness.txt fish-3.1.0/build_tools/iwyu.linux.imp000066400000000000000000000033101362100272700176220ustar00rootroot00000000000000# Map file for the include-what-you-use tool on Linux. [ { include: ["", "private", "", "public"] }, { include: ["", "private", "", "public"] }, { include: ["", "private", "", "public"] }, { include: ["", "private", "", "public"] }, { include: ["", "private", "", "public"] }, { include: ["", "public", "", "public"] }, { include: ["", "public", "", "public"] }, { include: ["", "public", "", "public"] }, { include: ["", "public", "", "public"] }, { symbol: ["size_t", "private", "", "public"] }, { symbol: ["size_t", "private", "", "public"] }, { symbol: ["size_t", "private", "", "public"] }, { symbol: ["intmax_t", "private", "", "public"] }, { symbol: ["intmax_t", "private", "", "public"] }, { symbol: ["uint32_t", "private", "", "public"] }, { symbol: ["uint32_t", "private", "", "public"] }, { symbol: ["uint64_t", "private", "", "public"] }, { symbol: ["uint64_t", "private", "", "public"] }, { symbol: ["uintmax_t", "private", "", "public"] }, { symbol: ["uintmax_t", "private", "", "public"] }, { symbol: ["clock_gettime", "private", "", "public"] }, { symbol: ["timespec", "private", "", "public"] }, { symbol: ["memset", "private", "", "public"] }, { symbol: ["strerror", "private", "", "public"] }, ] fish-3.1.0/build_tools/iwyu.osx.imp000066400000000000000000000171661362100272700173120ustar00rootroot00000000000000# Map file for the include-what-you-use tool on OS X. For some reason # the version installed by HomeBrew doesn't have useful mappings for the # system provided headers. This also has mappings for FreeBSD. [ { include: ["", "private", "", "public"] }, { include: ["", "private", "", "public"] }, { include: ["", "private", "", "public"] }, { include: ["", "private", "", "public"] }, { include: ["", "private", "", "public"] }, { include: ["", "private", "", "public"] }, { include: ["", "private", "", "public"] }, { include: ["", "private", "", "public"] }, { include: ["", "private", "", "public"] }, { include: ["", "private", "", "public"] }, { include: ["", "private", "", "public"] }, { include: ["", "private", "", "public"] }, { include: ["", "private", "", "public"] }, { include: ["", "private", "", "public"] }, { include: ["<_wctype.h>", "private", "", "public"] }, { include: ["", "private", "", "public"] }, { include: ["", "private", "", "public"] }, { include: ["", "private", "", "public"] }, { include: ["", "private", "", "public"] }, { include: ["", "private", "", "public"] }, { include: ["", "private", "", "public"] }, { include: ["", "private", "", "public"] }, { include: ["", "private", "", "public"] }, { include: ["", "private", "", "public"] }, { include: ["", "private", "", "public"] }, { include: ["", "private", "", "public"] }, { include: ["", "private", "", "public"] }, { include: ["", "private", "", "public"] }, { include: ["", "private", "", "public"] }, { include: ["", "private", "", "public"] }, { include: ["", "private", "", "public"] }, { include: ["<_types/_intmax_t.h>", "private", "", "public"] }, { include: ["<_types/_uintmax_t.h>", "private", "", "public"] }, { include: ["<_types/_uint8_t.h>", "private", "", "public"] }, { include: ["", "private", "", "public"] }, { include: ["<_types/_uint64_t.h>", "private", "", "public"] }, { include: ["", "private", "", "public"] }, { include: ["", "private", "", "public"] }, { include: ["", "private", "", "public"] }, { include: ["", "private", "", "public"] }, { include: ["<__functional_base>", "private", "", "public"] }, { include: ["<__functional_base>", "private", "", "public"] }, { include: ["<__functional_base>", "private", "", "public"] }, { include: ["<__tree>", "private", "", "public"] }, { include: ["<__tree>", "private", "", "public"] }, { include: ["<_types/_uint32_t.h>", "private", "", "public"] }, { include: ["", "private", "", "public"] }, { include: ["", "private", "", "public"] }, { include: ["", "private", "", "public"] }, { include: ["", "private", "", "public"] }, { include: ["", "private", "", "public"] }, { include: ["", "private", "", "public"] }, { include: ["", "private", "", "public"] }, { include: ["", "private", "", "public"] }, { include: ["", "private", "", "public"] }, { include: ["", "private", "", "public"] }, { include: ["", "private", "", "public"] }, { include: ["", "private", "", "public"] }, { include: ["", "private", "", "public"] }, { include: ["", "private", "", "public"] }, { include: ["", "private", "", "public"] }, { include: ["", "private", "", "public"] }, { include: ["", "private", "", "public"] }, { include: ["", "private", "", "public"] }, { include: ["", "private", "", "public"] }, { include: ["<__mutex_base>", "private", "", "public"] }, { include: ["<__hash_table>", "private", "", "public"] }, { include: ["<__hash_table>", "private", "", "public"] }, # { include: ["<>", "private", "<>", "public"] }, { symbol: ["size_t", "private", "", "public"] }, { symbol: ["mutex", "private", "", "public"] }, { symbol: ["sig_atomic_t", "private", "", "public"] }, { symbol: ["va_end", "private", "", "public"] }, { symbol: ["va_list", "private", "", "public"] }, { symbol: ["va_start", "private", "", "public"] }, { symbol: ["NULL", "private", "", "public"] }, { symbol: ["NULL", "private", "", "public"] }, { symbol: ["NULL", "private", "", "public"] }, { symbol: ["NULL", "private", "", "public"] }, { symbol: ["off_t", "private", "", "public"] }, { symbol: ["off_t", "private", "", "public"] }, { symbol: ["size_t", "private", "", "public"] }, { symbol: ["ssize_t", "private", "", "public"] }, { symbol: ["intptr_t", "private", "", "public"] }, { symbol: ["gid_t", "private", "", "public"] }, { symbol: ["uid_t", "private", "", "public"] }, { symbol: ["pid_t", "private", "", "public"] }, { symbol: ["pid_t", "private", "", "public"] }, { symbol: ["uid_t", "private", "", "public"] }, { symbol: ["gid_t", "private", "", "public"] }, { symbol: ["timeval", "private", "", "public"] }, { symbol: ["__uint32_t", "private", "", "public"] }, { symbol: ["uint32_t", "private", "", "public"] }, { symbol: ["intptr_t", "private", "", "public"] }, { symbol: ["tparm", "private", "", "public"] }, { symbol: ["tigetflag", "private", "", "public"] }, { symbol: ["ERR", "private", "", "public"] }, { symbol: ["OK", "private", "", "public"] }, { symbol: ["select", "private", "", "public"] }, { symbol: ["_LIBCPP_VERSION", "private", "", "public"] }, { symbol: ["_LIBCPP_VERSION", "private", "", "public"] }, { symbol: ["MB_CUR_MAX", "private", "", "public"] }, { symbol: ["MB_CUR_MAX", "private", "", "public"] }, ] fish-3.1.0/build_tools/lint.fish000077500000000000000000000115521362100272700166130ustar00rootroot00000000000000#!/usr/bin/env fish # # This is meant to be run by "make lint" or "make lint-all". It is not meant to # be run directly from a shell prompt. # # We don't include "missingInclude" as that doesn't find our config.h. # Missing includes will quickly be found by... compiling the thing anyway. set cppchecks warning,performance,portability,information #,missingInclude set cppcheck_args set c_files set all no set kernel_name (uname -s) set machine_type (uname -m) argparse a/all -- $argv # We only want -D and -I options to be passed thru to cppcheck. for arg in $argv if string match -q -- '-D*' $arg set cppcheck_args $cppcheck_args $arg else if string match -q -- '-I*' $arg set cppcheck_args $cppcheck_args $arg else if string match -q -- '-iquote*' $arg set cppcheck_args $cppcheck_args $arg end end # Not sure when this became necessary but without these flags cppcheck no longer works on macOS. # It complains that "Cppcheck cannot find all the include files." Adding these include paths should # be harmless everywhere else. set cppcheck_args $cppcheck_args -I /usr/include -I . if test "$machine_type" = "x86_64" set cppcheck_args -D__x86_64__ -D__LP64__ $cppcheck_args end if set -q _flag_all set c_files src/*.cpp set cppchecks "$cppchecks,unusedFunction" else # We haven't been asked to lint all the source. If there are uncommitted # changes lint those, else lint the files in the most recent commit. # Select (cached files) (modified but not cached, and untracked files) set files (git diff-index --cached HEAD --name-only) set files $files (git ls-files --exclude-standard --others --modified) if not set -q files[1] # No pending changes so lint the files in the most recent commit. set files (git diff-tree --no-commit-id --name-only -r HEAD) end # Extract just the C/C++ files that exist. set c_files for file in (string match -r '.*\.c(?:pp)?$' -- $files) test -f $file; and set c_files $c_files $file end end # We now have a list of files to check so run the linters. if set -q c_files[1] if type -q include-what-you-use echo echo ======================================== echo Running IWYU echo ======================================== for c_file in $c_files switch $kernel_name case Darwin FreeBSD include-what-you-use -Xiwyu --no_default_mappings -Xiwyu \ --mapping_file=build_tools/iwyu.osx.imp --std=c++11 \ $cppcheck_args $c_file 2>&1 case Linux include-what-you-use -Xiwyu --mapping_file=build_tools/iwyu.linux.imp \ $cppcheck_args $c_file 2>&1 case '*' # hope for the best include-what-you-use --std=c++11 $cppcheck_args $c_file 2>&1 end end end if type -q cppcheck echo echo ======================================== echo Running cppcheck echo ======================================== # The stderr to stdout redirection is because cppcheck, incorrectly IMHO, writes its # diagnostic messages to stderr. Anyone running this who wants to capture its output will # expect those messages to be written to stdout. set -l cn (set_color normal) set -l cb (set_color --bold) set -l cu (set_color --underline) set -l cm (set_color magenta) set -l cbrm (set_color brmagenta) set -l template "[$cb$cu{file}$cn$cb:{line}$cn] $cbrm{severity}$cm ({id}):$cn\n {message}" set cppcheck_args -q --verbose --std=c++11 --std=posix --language=c++ --template $template \ --suppress=missingIncludeSystem --inline-suppr --enable=$cppchecks \ --rule-file=.cppcheck.rules --suppressions-list=.cppcheck.suppressions $cppcheck_args cppcheck $cppcheck_args $c_files 2>&1 echo echo ======================================== echo 'Running `cppcheck --check-config` to identify missing includes and similar problems.' echo 'Ignore unmatchedSuppression warnings as they are probably false positives we' echo 'cannot suppress.' echo ======================================== cppcheck $cppcheck_args --check-config $c_files 2>&1 end if type -q oclint echo echo ======================================== echo Running oclint echo ======================================== # The stderr to stdout redirection is because oclint, incorrectly writes its final summary # counts of the errors detected to stderr. Anyone running this who wants to capture its # output will expect those messages to be written to stdout. oclint $c_files -- $argv 2>&1 end else echo echo 'WARNING: No C/C++ files to check' echo end fish-3.1.0/build_tools/list_committers_since.fish000077500000000000000000000016271362100272700222510ustar00rootroot00000000000000#! /usr/bin/env fish set TAG $argv[1] if test -z "$TAG" echo "Tag name required." exit 1 end if not contains -- $TAG (git tag) echo "$TAG is not a valid tag name." exit 1 end set committers_to_tag (mktemp) set committers_from_tag (mktemp) # You might think it would be better to case-insensitively sort/compare the names # to produce a more natural-looking list. # Unicode collation tables mean that this is fraught with danger; for example, the # "“" character will not case-fold in UTF-8 locales. sort suggests using the C locale! git log "$TAG" --format="%aN" --reverse | sort -u >$committers_to_tag git log "$TAG".. --format="%aN" --reverse | sort -u >$committers_from_tag echo New committers: echo (comm -13 $committers_to_tag $committers_from_tag)',' echo echo Returning committers: echo (comm -12 $committers_to_tag $committers_from_tag)',' rm $committers_to_tag $committers_from_tag fish-3.1.0/build_tools/littlecheck.py000077500000000000000000000336461362100272700176470ustar00rootroot00000000000000#!/usr/bin/env python """ Command line test driver. """ from __future__ import unicode_literals import argparse import io import re import shlex import subprocess import sys # A regex showing how to run the file. RUN_RE = re.compile(r"\s*#\s*RUN:\s+(.*)\n") # A regex capturing lines that should be checked against stdout. CHECK_STDOUT_RE = re.compile(r"\s*#\s*CHECK:\s+(.*)\n") # A regex capturing lines that should be checked against stderr. CHECK_STDERR_RE = re.compile(r"\s*#\s*CHECKERR:\s+(.*)\n") class Config(object): def __init__(self): # Whether to have verbose output. self.verbose = False # Whether output gets ANSI colorization. self.colorize = False def colors(self): """ Return a dictionary mapping color names to ANSI escapes """ def ansic(n): return "\033[%dm" % n if self.colorize else "" return { "RESET": ansic(0), "BOLD": ansic(1), "NORMAL": ansic(39), "BLACK": ansic(30), "RED": ansic(31), "GREEN": ansic(32), "YELLOW": ansic(33), "BLUE": ansic(34), "MAGENTA": ansic(35), "CYAN": ansic(36), "LIGHTGRAY": ansic(37), "DARKGRAY": ansic(90), "LIGHTRED": ansic(91), "LIGHTGREEN": ansic(92), "LIGHTYELLOW": ansic(93), "LIGHTBLUE": ansic(94), "LIGHTMAGENTA": ansic(95), "LIGHTCYAN": ansic(96), "WHITE": ansic(97), } def output(*args): print("".join(args) + "\n") class CheckerError(Exception): """Exception subclass for check line parsing. Attributes: line: the Line object on which the exception occurred. """ def __init__(self, message, line=None): super(CheckerError, self).__init__(message) self.line = line class Line(object): """ A line that remembers where it came from. """ def __init__(self, text, number, file): self.text = text self.number = number self.file = file def subline(self, text): """ Return a substring of our line with the given text, preserving number and file. """ return Line(text, self.number, self.file) @staticmethod def readfile(file, name): return [Line(text, idx + 1, name) for idx, text in enumerate(file)] def is_empty_space(self): return not self.text or self.text.isspace() class RunCmd(object): """ A command to run on a given Checker. Attributes: args: Unexpanded shell command as a string. """ def __init__(self, args, line): self.args = args self.line = line @staticmethod def parse(line): if not shlex.split(line.text): raise CheckerError("Invalid RUN command", line) return RunCmd(line.text, line) class TestFailure(object): def __init__(self, line, check, testrun): self.line = line self.check = check self.testrun = testrun self.error_annotation_line = None def message(self): fields = self.testrun.config.colors() fields["name"] = self.testrun.name fields["subbed_command"] = self.testrun.subbed_command if self.line: fields.update( { "output_file": self.line.file, "output_lineno": self.line.number, "output_line": self.line.text.rstrip("\n"), } ) if self.check: fields.update( { "input_file": self.check.line.file, "input_lineno": self.check.line.number, "input_line": self.check.line.text, "check_type": self.check.type, } ) fmtstrs = ["{RED}Failure{RESET} in {name}:", ""] if self.line and self.check: fmtstrs += [ " The {check_type} on line {input_lineno} wants:", " {BOLD}{input_line}{RESET}", "", " which failed to match line {output_file}:{output_lineno}:", " {BOLD}{output_line}{RESET}", "", ] elif self.check: fmtstrs += [ " The {check_type} on line {input_lineno} wants:", " {BOLD}{input_line}{RESET}", "", " but there was no remaining output to match.", "", ] else: fmtstrs += [ " There were no remaining checks left to match {output_file}:{output_lineno}:", " {BOLD}{output_line}{RESET}", "", ] if self.error_annotation_line: fields["error_annotation"] = self.error_annotation_line.text fields["error_annotation_lineno"] = self.error_annotation_line.number fmtstrs += [ " additional output on stderr:{error_annotation_lineno}:", " {BOLD}{error_annotation}{RESET}", ] fmtstrs += [" when running command:", " {subbed_command}"] return "\n".join(fmtstrs).format(**fields) def print_message(self): """ Print our message to stdout. """ print(self.message()) def perform_substitution(input_str, subs): """ Perform the substitutions described by subs to str Return the substituted string. """ # Sort our substitutions into a list of tuples (key, value), descending by length. # It needs to be descending because we need to try longer substitutions first. subs_ordered = sorted(subs.items(), key=lambda s: len(s[0]), reverse=True) def subber(m): # We get the entire sequence of characters. # Replace just the prefix and return it. text = m.group(1) for key, replacement in subs_ordered: if text.startswith(key): return replacement + text[len(key) :] raise CheckerError("Unknown substitution: " + m.group(0)) return re.sub(r"%(%|[a-zA-Z0-9_-]+)", subber, input_str) class TestRun(object): def __init__(self, name, runcmd, checker, subs, config): self.name = name self.runcmd = runcmd self.subbed_command = perform_substitution(runcmd.args, subs) self.checker = checker self.subs = subs self.config = config def check(self, lines, checks): # Reverse our lines and checks so we can pop off the end. lineq = lines[::-1] checkq = checks[::-1] while lineq and checkq: line = lineq[-1] check = checkq[-1] if check.regex.match(line.text): # This line matched this checker, continue on. lineq.pop() checkq.pop() elif line.is_empty_space(): # Skip all whitespace input lines. lineq.pop() else: # Failed to match. return TestFailure(line, check, self) # Drain empties. while lineq and lineq[-1].is_empty_space(): lineq.pop() # If there's still lines or checkers, we have a failure. # Otherwise it's success. if lineq: return TestFailure(lineq[-1], None, self) elif checkq: return TestFailure(None, checkq[-1], self) else: return None def run(self): """ Run the command. Return a TestFailure, or None. """ def split_by_newlines(s): """ Decode a string and split it by newlines only, retaining the newlines. """ return [s + "\n" for s in s.decode("utf-8").split("\n")] PIPE = subprocess.PIPE if self.config.verbose: print(self.subbed_command) proc = subprocess.Popen( self.subbed_command, stdin=PIPE, stdout=PIPE, stderr=PIPE, shell=True, close_fds=True, # For Python 2.6 as shipped on RHEL 6 ) stdout, stderr = proc.communicate() outlines = [ Line(text, idx + 1, "stdout") for idx, text in enumerate(split_by_newlines(stdout)) ] errlines = [ Line(text, idx + 1, "stderr") for idx, text in enumerate(split_by_newlines(stderr)) ] outfail = self.check(outlines, self.checker.outchecks) errfail = self.check(errlines, self.checker.errchecks) # It's possible that something going wrong on stdout resulted in new # text being printed on stderr. If we have an outfailure, and either # non-matching or unmatched stderr text, then annotate the outfail # with it. if outfail and errfail and errfail.line: outfail.error_annotation_line = errfail.line return outfail if outfail else errfail class CheckCmd(object): def __init__(self, line, checktype, regex): self.line = line self.type = checktype self.regex = regex @staticmethod def parse(line, checktype): # type: (Line) -> CheckCmd # Everything inside {{}} is a regular expression. # Everything outside of it is a literal string. # Split around {{...}}. Then every odd index will be a regex, and # evens will be literals. # Note that if {{...}} appears first we will get an empty string in # the split array, so the {{...}} matches are always at odd indexes. bracket_re = re.compile( r""" \{\{ # Two open brackets (.*?) # Nongreedy capture \}\} # Two close brackets """, re.VERBOSE, ) pieces = bracket_re.split(line.text) even = True re_strings = [] for piece in pieces: if even: # piece is a literal string. re_strings.append(re.escape(piece)) else: # piece is a regex (found inside {{...}}). # Verify the regex can be compiled. try: re.compile(piece) except re.error: raise CheckerError("Invalid regular expression: '%s'" % piece, line) re_strings.append(piece) even = not even # Enclose each piece in a non-capturing group. # This ensures that lower-precedence operators don't trip up catenation. # For example: {{b|c}}d would result in /b|cd/ which is different. # Backreferences are assumed to match across the entire string. re_strings = ["(?:%s)" % s for s in re_strings] # Anchor at beginning and end (allowing arbitrary whitespace), and maybe # a terminating newline. # We need the anchors because Python's match() matches an arbitrary prefix, # not the entire string. re_strings = [r"^\s*"] + re_strings + [r"\s*\n?$"] full_re = re.compile("".join(re_strings)) return CheckCmd(line, checktype, full_re) class Checker(object): def __init__(self, name, lines): self.name = name # Helper to yield subline containing group1 from all matching lines. def group1s(regex): for line in lines: m = regex.match(line.text) if m: yield line.subline(m.group(1)) # Find run commands. self.runcmds = [RunCmd.parse(sl) for sl in group1s(RUN_RE)] if not self.runcmds: raise CheckerError("No runlines ('# RUN') found") # Find check cmds. self.outchecks = [ CheckCmd.parse(sl, "CHECK") for sl in group1s(CHECK_STDOUT_RE) ] self.errchecks = [ CheckCmd.parse(sl, "CHECKERR") for sl in group1s(CHECK_STDERR_RE) ] def check_file(input_file, name, subs, config, failure_handler): """ Check a single file. Return a True on success, False on error. """ success = True lines = Line.readfile(input_file, name) checker = Checker(name, lines) for runcmd in checker.runcmds: failure = TestRun(name, runcmd, checker, subs, config).run() if failure: failure_handler(failure) success = False return success def check_path(path, subs, config, failure_handler): with io.open(path, encoding="utf-8") as fd: return check_file(fd, path, subs, config, failure_handler) def parse_subs(subs): """ Given a list of input substitutions like 'foo=bar', return a dictionary like {foo:bar}, or exit if invalid. """ result = {} for sub in subs: try: key, val = sub.split("=", 1) if not key: print("Invalid substitution %s: empty key" % sub) sys.exit(1) if not val: print("Invalid substitution %s: empty value" % sub) sys.exit(1) result[key] = val except ValueError: print("Invalid substitution %s: equal sign not found" % sub) sys.exit(1) return result def get_argparse(): """ Return a littlecheck argument parser. """ parser = argparse.ArgumentParser( description="littlecheck: command line tool tester." ) parser.add_argument( "-s", "--substitute", type=str, help="Add a new substitution for RUN lines. Example: bash=/bin/bash", action="append", default=[], ) parser.add_argument("file", nargs="+", help="File to check") return parser def main(): args = get_argparse().parse_args() # Default substitution is %% -> % def_subs = {"%": "%"} def_subs.update(parse_subs(args.substitute)) success = True config = Config() config.colorize = sys.stdout.isatty() for path in args.file: subs = def_subs.copy() subs["s"] = path if not check_path(path, subs, config, TestFailure.print_message): success = False sys.exit(0 if success else 1) if __name__ == "__main__": main() fish-3.1.0/build_tools/make_pkg.sh000077500000000000000000000021601362100272700170770ustar00rootroot00000000000000#!/bin/sh # Script to produce an OS X installer .pkg and .app(.zip) VERSION=$(git describe --always --dirty 2>/dev/null) if test -z "$VERSION" ; then echo "Could not get version from git" if test -f version; then VERSION=$(cat version) fi fi echo "Version is $VERSION" set -x #Exit on error set -e PKGDIR=$(mktemp -d) SRC_DIR=$PWD OUTPUT_PATH=${FISH_ARTEFACT_PATH:-~/fish_built} mkdir -p "$PKGDIR/build" "$PKGDIR/root" "$PKGDIR/intermediates" "$PKGDIR/dst" { cd "$PKGDIR/build" && cmake -DCMAKE_BUILD_TYPE=RelWithDebInfo "$SRC_DIR" && make -j 4 && env DESTDIR="$PKGDIR/root/" make install; } pkgbuild --scripts "$SRC_DIR/build_tools/osx_package_scripts" --root "$PKGDIR/root/" --identifier 'com.ridiculousfish.fish-shell-pkg' --version "$VERSION" "$PKGDIR/intermediates/fish.pkg" productbuild --package-path "$PKGDIR/intermediates" --distribution "$SRC_DIR/build_tools/osx_distribution.xml" --resources "$SRC_DIR/build_tools/osx_package_resources/" "$OUTPUT_PATH/fish-$VERSION.pkg" # Make the app { cd "$PKGDIR/build" && make fish_macapp && zip -r "$OUTPUT_PATH/fish-$VERSION.app.zip" fish.app; } rm -r "$PKGDIR" fish-3.1.0/build_tools/osx_distribution.xml000066400000000000000000000014531362100272700211200ustar00rootroot00000000000000 fish shell fish.pkg fish-3.1.0/build_tools/osx_package_resources/000077500000000000000000000000001362100272700213415ustar00rootroot00000000000000fish-3.1.0/build_tools/osx_package_resources/terminal_logo.png000066400000000000000000001053651362100272700247140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tf000066400000000000000000000015721362100272700235160ustar00rootroot00000000000000{\rtf1\ansi\ansicpg1252\cocoartf1485\cocoasubrtf410 {\fonttbl\f0\fnil\fcharset0 HelveticaNeue;\f1\fnil\fcharset0 Menlo-Regular;} {\colortbl;\red255\green255\blue255;} {\*\expandedcolortbl;\csgenericrgb\c100000\c100000\c100000;} {\info {\author dlkfjslfjsfdlkfk}}\margl1440\margr1440\vieww10800\viewh8400\viewkind0 \pard\tx720\tx1440\tx2160\tx2880\tx3600\tx4320\tx5040\tx5760\tx6480\tx7200\tx7920\tx8640\pardirnatural\partightenfactor0 \f0\fs30 \cf0 Fish is a smart and user friendly command line shell. For more information, visit {\field{\*\fldinst{HYPERLINK "https://fishshell.com"}}{\fldrslt https://fishshell.com}}\ \ fish will be installed into \f1\fs26 /usr/local/ \f0\fs30 , and fish will be added to \f1\fs26 /etc/shells \f0\fs30 if necessary.\ \ Your default shell will \i not \i0 be changed. To make fish your default, run:\ \ \f1 chsh -s /usr/local/bin/fish \f0 \ \ Enjoy!\ }fish-3.1.0/build_tools/osx_package_scripts/000077500000000000000000000000001362100272700210165ustar00rootroot00000000000000fish-3.1.0/build_tools/osx_package_scripts/add-shell000077500000000000000000000017011362100272700226000ustar00rootroot00000000000000#!/bin/sh -e # Modified from Debian's add-shell to work on OS X if test $# -eq 0 then echo usage: $0 shellname [shellname ...] exit 1 fi scriptname=`basename "$0"` if [[ $UID -ne 0 ]]; then echo "${scriptname} must be run as root" exit 1 fi file=/etc/shells # I want this to be GUARANTEED to be on the same filesystem as $file tmpfile=${file}.tmp set -o noclobber trap "rm -f $tmpfile" EXIT if ! cat $file > $tmpfile then cat 1>&2 <> "$tmpfile" fi for i do if ! grep -q "^${i}$" "$tmpfile" then echo $i >> "$tmpfile" fi done chmod 0644 $tmpfile chown root:wheel $tmpfile mv $tmpfile $file trap "" EXIT exit 0 fish-3.1.0/build_tools/osx_package_scripts/postinstall000077500000000000000000000001211362100272700233120ustar00rootroot00000000000000#!/bin/sh -x ./add-shell /usr/local/bin/fish > /tmp/fish_postinstall_output.log fish-3.1.0/build_tools/style.fish000077500000000000000000000062061362100272700170050ustar00rootroot00000000000000#!/usr/bin/env fish # # This runs C++ files and fish scripts (*.fish) through their respective code # formatting programs. # set git_clang_format no set c_files set fish_files set python_files set all no if test "$argv[1]" = "--all" set all yes set -e argv[1] end if set -q argv[1] echo "Unexpected arguments: '$argv'" exit 1 end if test $all = yes set files (git status --porcelain --short --untracked-files=all | sed -e 's/^ *[^ ]* *//') if set -q files[1] echo echo You have uncommitted changes. Cowardly refusing to restyle the entire code base. echo exit 1 end set c_files src/*.h src/*.cpp src/*.c set fish_files (printf '%s\n' share/***.fish) set python_files **.py else # We haven't been asked to reformat all the source. If there are uncommitted changes reformat # those using `git clang-format`. Else reformat the files in the most recent commit. # Select (cached files) (modified but not cached, and untracked files) set files (git diff-index --cached HEAD --name-only) (git ls-files --exclude-standard --others --modified) if set -q files[1] set git_clang_format yes else # No pending changes so lint the files in the most recent commit. set files (git diff-tree --no-commit-id --name-only -r HEAD) end # Extract just the C/C++ files that exist. set c_files for file in (string match -r '^.*\.(?:c|cpp|h)$' -- $files) test -f $file; and set c_files $c_files $file end # Extract just the fish files. set fish_files (string match -r '^.*\.fish$' -- $files) set python_files (string match -r '^.*\.py$' -- $files) end set -l red (set_color red) set -l green (set_color green) set -l blue (set_color blue) set -l normal (set_color normal) # Run the C++ reformatter if we have any C++ files. if set -q c_files[1] if test $git_clang_format = yes if type -q git-clang-format echo === Running "$red"git-clang-format"$normal" git add $c_files git-clang-format else echo echo 'WARNING: Cannot find git-clang-format command' echo end else if type -q clang-format echo === Running "$red"clang-format"$normal" for file in $c_files cp $file $file.new # preserves mode bits clang-format $file >$file.new if cmp --quiet $file $file.new rm $file.new else echo $file was NOT correctly formatted mv $file.new $file end end else echo echo 'WARNING: Cannot find clang-format command' echo end end # Run the fish reformatter if we have any fish files. if set -q fish_files[1] if not type -q fish_indent make fish_indent set PATH . $PATH end echo === Running "$green"fish_indent"$normal" fish_indent -w -- $fish_files end if set -q python_files[1] if not type -q black echo echo Please install "`black`" to style python echo else echo === Running "$blue"black"$normal" black $python_files end end fish-3.1.0/build_tools/ubsan.blacklist000066400000000000000000000002731362100272700177670ustar00rootroot00000000000000# Ubuntu Xenial (used for Travis CI builds) ships libstdc++ 5.4.0 which contains undefined behaviour # See https://gcc.gnu.org/bugzilla/show_bug.cgi?id=63345 object-size:*bits/stl_tree.h fish-3.1.0/cmake/000077500000000000000000000000001362100272700135245ustar00rootroot00000000000000fish-3.1.0/cmake/Benchmark.cmake000066400000000000000000000002331362100272700164160ustar00rootroot00000000000000# Support for benchmarking fish. ADD_CUSTOM_TARGET(benchmark COMMAND ${CMAKE_SOURCE_DIR}/benchmarks/driver.sh $ USES_TERMINAL ) fish-3.1.0/cmake/CheckIncludeFiles.cmake000066400000000000000000000107471362100272700200430ustar00rootroot00000000000000# Distributed under the OSI-approved BSD 3-Clause License. See full license information in # doc_src/license.hdr or https://cmake.org/licensing for details. #.rst: # CheckIncludeFiles # ----------------- # # Provides a macro to check if a list of one or more header files can # be included together in ``C``. # # .. command:: CHECK_INCLUDE_FILES # # :: # # CHECK_INCLUDE_FILES("" [LANGUAGE ]) # # Check if the given ```` list may be included together # in a ``C`` source file and store the result in an internal cache # entry named ````. Specify the ```` argument # as a :ref:`;-list ` of header file names. # # If LANGUAGE is set, the specified compiler will be used to perform the # check. Acceptable values are C and CXX. # # The following variables may be set before calling this macro to modify # the way the check is run: # # ``CMAKE_REQUIRED_FLAGS`` # string of compile command line flags # ``CMAKE_REQUIRED_DEFINITIONS`` # list of macros to define (-DFOO=bar) # ``CMAKE_REQUIRED_INCLUDES`` # list of include directories # ``CMAKE_REQUIRED_QUIET`` # execute quietly without messages # # See modules :module:`CheckIncludeFile` and :module:`CheckIncludeFileCXX` # to check for a single header file in ``C`` or ``CXX`` languages. macro(CHECK_INCLUDE_FILES INCLUDE VARIABLE) if(NOT DEFINED "${VARIABLE}") set(CMAKE_CONFIGURABLE_FILE_CONTENT "/* */\n") if("x${ARGN}" STREQUAL "x") if(CMAKE_C_COMPILER_LOADED) set(_lang C) elseif(CMAKE_CXX_COMPILER_LOADED) set(_lang CXX) else() message(FATAL_ERROR "CHECK_INCLUDE_FILES needs either C or CXX language enabled") endif() elseif("x${ARGN}" MATCHES "^xLANGUAGE;([a-zA-Z]+)$") set(_lang "${CMAKE_MATCH_1}") else() message(FATAL_ERROR "Unknown arguments:\n ${ARGN}\n") endif() if(_lang STREQUAL "C") set(src ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CheckIncludeFiles/${var}.c) elseif(_lang STREQUAL "CXX") set(src ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CheckIncludeFiles/${var}.cpp) else() message(FATAL_ERROR "Unknown language:\n ${_lang}\nSupported languages: C, CXX.\n") endif() if(CMAKE_REQUIRED_INCLUDES) set(CHECK_INCLUDE_FILES_INCLUDE_DIRS "-DINCLUDE_DIRECTORIES=${CMAKE_REQUIRED_INCLUDES}") else() set(CHECK_INCLUDE_FILES_INCLUDE_DIRS) endif() set(CHECK_INCLUDE_FILES_CONTENT "/* */\n") set(MACRO_CHECK_INCLUDE_FILES_FLAGS ${CMAKE_REQUIRED_FLAGS}) foreach(FILE ${INCLUDE}) string(APPEND CMAKE_CONFIGURABLE_FILE_CONTENT "#include <${FILE}>\n") endforeach() string(APPEND CMAKE_CONFIGURABLE_FILE_CONTENT "\n\nint main(void){return 0;}\n") configure_file("${CMAKE_ROOT}/Modules/CMakeConfigurableFile.in" "${src}" @ONLY) set(_INCLUDE ${INCLUDE}) # remove empty elements if("${_INCLUDE}" MATCHES "^([^;]+);.+;([^;]+)$") list(LENGTH _INCLUDE _INCLUDE_LEN) set(_description "${_INCLUDE_LEN} include files ${CMAKE_MATCH_1}, ..., ${CMAKE_MATCH_2}") elseif("${_INCLUDE}" MATCHES "^([^;]+);([^;]+)$") set(_description "include files ${CMAKE_MATCH_1}, ${CMAKE_MATCH_2}") else() set(_description "include file ${_INCLUDE}") endif() if(NOT CMAKE_REQUIRED_QUIET) message(STATUS "Looking for ${_description}") endif() try_compile(${VARIABLE} ${CMAKE_BINARY_DIR} ${src} COMPILE_DEFINITIONS ${CMAKE_REQUIRED_DEFINITIONS} CMAKE_FLAGS -DCOMPILE_DEFINITIONS:STRING=${MACRO_CHECK_INCLUDE_FILES_FLAGS} "${CHECK_INCLUDE_FILES_INCLUDE_DIRS}" OUTPUT_VARIABLE OUTPUT) if(${VARIABLE}) if(NOT CMAKE_REQUIRED_QUIET) message(STATUS "Looking for ${_description} - found") endif() set(${VARIABLE} 1 CACHE INTERNAL "Have include ${INCLUDE}") file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log "Determining if files ${INCLUDE} " "exist passed with the following output:\n" "${OUTPUT}\n\n") else() if(NOT CMAKE_REQUIRED_QUIET) message(STATUS "Looking for ${_description} - not found") endif() set(${VARIABLE} "" CACHE INTERNAL "Have includes ${INCLUDE}") file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log "Determining if files ${INCLUDE} " "exist failed with the following output:\n" "${OUTPUT}\nSource:\n${CMAKE_CONFIGURABLE_FILE_CONTENT}\n") endif() endif() endmacro() fish-3.1.0/cmake/ConfigureChecks.cmake000066400000000000000000000164651362100272700176040ustar00rootroot00000000000000# The following defines affect the environment configuration tests are run in: # CMAKE_REQUIRED_DEFINITIONS, CMAKE_REQUIRED_FLAGS, CMAKE_REQUIRED_LIBRARIES, # and CMAKE_REQUIRED_INCLUDES # `wcstod_l` is a GNU-extension, sometimes hidden behind GNU-related defines. # This is the case for at least Cygwin and Newlib. LIST(APPEND CMAKE_REQUIRED_DEFINITIONS -D_GNU_SOURCE=1) IF(APPLE) INCLUDE(CheckCXXCompilerFlag) CHECK_CXX_COMPILER_FLAG("-Werror=unguarded-availability" REQUIRES_UNGUARDED_AVAILABILITY) IF(REQUIRES_UNGUARDED_AVAILABILITY) LIST(APPEND CMAKE_REQUIRED_FLAGS ${CMAKE_REQUIRED_FLAGS} "-Werror=unguarded-availability") ENDIF() ENDIF() # Try using CMake's own logic to locate curses/ncurses FIND_PACKAGE(Curses) IF(NOT ${CURSES_FOUND}) # CMake has trouble finding platform-specific system libraries # installed to multiarch paths (e.g. /usr/lib/x86_64-linux-gnu) # if not symlinked or passed in as a manual define. MESSAGE("Falling back to pkg-config for (n)curses detection") INCLUDE(FindPkgConfig) PKG_SEARCH_MODULE(CURSES REQUIRED ncurses curses) SET(CURSES_CURSES_LIBRARY ${CURSES_LIBRARIES}) SET(CURSES_LIBRARY ${CURSES_LIBRARIES}) ENDIF() # Get threads. set(THREADS_PREFER_PTHREAD_FLAG ON) # FindThreads < 3.4.0 doesn't work for C++-only projects IF(CMAKE_VERSION VERSION_LESS 3.4.0) ENABLE_LANGUAGE(C) ENDIF() FIND_PACKAGE(Threads REQUIRED) # Detect WSL. Does not match against native Windows/WIN32. if (CMAKE_HOST_SYSTEM_VERSION MATCHES ".*-Microsoft") SET(WSL 1) endif() # Set up the config.h file. SET(PACKAGE_NAME "fish") SET(PACKAGE_TARNAME "fish") INCLUDE(CheckCXXSymbolExists) INCLUDE(CheckIncludeFileCXX) INCLUDE(CheckIncludeFiles) INCLUDE(CheckStructHasMember) INCLUDE(CheckCXXSourceCompiles) INCLUDE(CheckTypeSize) INCLUDE(CMakePushCheckState) CHECK_CXX_SYMBOL_EXISTS(backtrace_symbols execinfo.h HAVE_BACKTRACE_SYMBOLS) CHECK_CXX_SYMBOL_EXISTS(clock_gettime time.h HAVE_CLOCK_GETTIME) CHECK_CXX_SYMBOL_EXISTS(ctermid_r stdio.h HAVE_CTERMID_R) CHECK_STRUCT_HAS_MEMBER("struct dirent" d_type dirent.h HAVE_STRUCT_DIRENT_D_TYPE LANGUAGE CXX) CHECK_CXX_SYMBOL_EXISTS(dirfd "sys/types.h;dirent.h" HAVE_DIRFD) CHECK_INCLUDE_FILE_CXX(execinfo.h HAVE_EXECINFO_H) CHECK_CXX_SYMBOL_EXISTS(flock sys/file.h HAVE_FLOCK) # futimens is new in OS X 10.13 but is a weak symbol. # Don't assume it exists just because we can link - it may be null. CHECK_CXX_SYMBOL_EXISTS(futimens sys/stat.h HAVE_FUTIMENS) CHECK_CXX_SYMBOL_EXISTS(futimes sys/time.h HAVE_FUTIMES) CHECK_CXX_SYMBOL_EXISTS(getifaddrs ifaddrs.h HAVE_GETIFADDRS) CHECK_CXX_SYMBOL_EXISTS(getpwent pwd.h HAVE_GETPWENT) CHECK_CXX_SYMBOL_EXISTS(getrusage sys/resource.h HAVE_GETRUSAGE) CHECK_CXX_SYMBOL_EXISTS(gettext libintl.h HAVE_GETTEXT) CHECK_CXX_SYMBOL_EXISTS(killpg "sys/types.h;signal.h" HAVE_KILLPG) CHECK_CXX_SYMBOL_EXISTS(lrand48_r stdlib.h HAVE_LRAND48_R) # mkostemp is in stdlib in glibc and FreeBSD, but unistd on macOS CHECK_CXX_SYMBOL_EXISTS(mkostemp "stdlib.h;unistd.h" HAVE_MKOSTEMP) SET(HAVE_CURSES_H ${CURSES_HAVE_CURSES_H}) SET(HAVE_NCURSES_CURSES_H ${CURSES_HAVE_NCURSES_CURSES_H}) SET(HAVE_NCURSES_H ${CURSES_HAVE_NCURSES_H}) IF(HAVE_CURSES_H) CHECK_INCLUDE_FILES("curses.h;term.h" HAVE_TERM_H) ENDIF() IF(NOT HAVE_TERM_H) CHECK_INCLUDE_FILE_CXX("ncurses/term.h" HAVE_NCURSES_TERM_H) ENDIF() CHECK_INCLUDE_FILE_CXX(siginfo.h HAVE_SIGINFO_H) CHECK_INCLUDE_FILE_CXX(spawn.h HAVE_SPAWN_H) CHECK_STRUCT_HAS_MEMBER("struct stat" st_ctime_nsec "sys/stat.h" HAVE_STRUCT_STAT_ST_CTIME_NSEC LANGUAGE CXX) CHECK_STRUCT_HAS_MEMBER("struct stat" st_mtimespec.tv_nsec "sys/stat.h" HAVE_STRUCT_STAT_ST_MTIMESPEC_TV_NSEC LANGUAGE CXX) CHECK_STRUCT_HAS_MEMBER("struct stat" st_mtim.tv_nsec "sys/stat.h" HAVE_STRUCT_STAT_ST_MTIM_TV_NSEC LANGUAGE CXX) CHECK_CXX_SYMBOL_EXISTS(sys_errlist stdio.h HAVE_SYS_ERRLIST) CHECK_INCLUDE_FILE_CXX(sys/ioctl.h HAVE_SYS_IOCTL_H) CHECK_INCLUDE_FILE_CXX(sys/select.h HAVE_SYS_SELECT_H) CHECK_INCLUDE_FILES("sys/types.h;sys/sysctl.h" HAVE_SYS_SYSCTL_H) CHECK_INCLUDE_FILE_CXX(termios.h HAVE_TERMIOS_H) # Needed for TIOCGWINSZ CHECK_CXX_SYMBOL_EXISTS(wcscasecmp wchar.h HAVE_WCSCASECMP) CHECK_CXX_SYMBOL_EXISTS(wcsdup wchar.h HAVE_WCSDUP) CHECK_CXX_SYMBOL_EXISTS(wcslcpy wchar.h HAVE_WCSLCPY) CHECK_CXX_SYMBOL_EXISTS(wcsncasecmp wchar.h HAVE_WCSNCASECMP) CHECK_CXX_SYMBOL_EXISTS(wcsndup wchar.h HAVE_WCSNDUP) # These are for compatibility with Solaris 10, which places the following # in the std namespace. IF(NOT HAVE_WCSNCASECMP) CHECK_CXX_SYMBOL_EXISTS(std::wcscasecmp wchar.h HAVE_STD__WCSCASECMP) ENDIF() IF(NOT HAVE_WCSDUP) CHECK_CXX_SYMBOL_EXISTS(std::wcsdup wchar.h HAVE_STD__WCSDUP) ENDIF() IF(NOT HAVE_WCSNCASECMP) CHECK_CXX_SYMBOL_EXISTS(std::wcsncasecmp wchar.h HAVE_STD__WCSNCASECMP) ENDIF() # `xlocale.h` is required to find `wcstod_l` in `wchar.h` under FreeBSD, # but it's not present under Linux. CHECK_INCLUDE_FILES("xlocale.h" HAVE_XLOCALE_H) IF(HAVE_XLOCALE_H) LIST(APPEND WCSTOD_L_INCLUDES "xlocale.h") ENDIF() LIST(APPEND WCSTOD_L_INCLUDES "wchar.h") CHECK_CXX_SYMBOL_EXISTS(wcstod_l "${WCSTOD_L_INCLUDES}" HAVE_WCSTOD_L) CHECK_CXX_SYMBOL_EXISTS(_sys_errs stdlib.h HAVE__SYS__ERRS) CMAKE_PUSH_CHECK_STATE() SET(CMAKE_EXTRA_INCLUDE_FILES termios.h sys/ioctl.h) CHECK_TYPE_SIZE("struct winsize" STRUCT_WINSIZE LANGUAGE CXX) CHECK_CXX_SYMBOL_EXISTS("TIOCGWINSZ" "termios.h;sys/ioctl.h" HAVE_TIOCGWINSZ) IF(STRUCT_WINSIZE GREATER -1 AND HAVE_TIOCGWINSZ EQUAL 1) SET(HAVE_WINSIZE 1) ENDIF() CMAKE_POP_CHECK_STATE() CHECK_TYPE_SIZE("wchar_t[8]" WCHAR_T_BITS LANGUAGE CXX) # Solaris, NetBSD and X/Open-conforming systems have a fixed-args tparm SET(TPARM_INCLUDES) IF(HAVE_NCURSES_H) SET(TPARM_INCLUDES "${TPARM_INCLUDES}#include \n") ELSEIF(HAVE_NCURSES_CURSES_H) SET(TPARM_INCLUDES "${TPARM_INCLUDES}#include \n") ELSE() SET(TPARM_INCLUDES "${TPARM_INCLUDES}#include \n") ENDIF() IF(HAVE_TERM_H) SET(TPARM_INCLUDES "${TPARM_INCLUDES}#include \n") ELSEIF(HAVE_NCURSES_TERM_H) SET(TPARM_INCLUDES "${TPARM_INCLUDES}#include \n") ENDIF() CMAKE_PUSH_CHECK_STATE() LIST(APPEND CMAKE_REQUIRED_LIBRARIES ${CURSES_LIBRARY}) CHECK_CXX_SOURCE_COMPILES(" ${TPARM_INCLUDES} int main () { tparm( \"\" ); } " TPARM_TAKES_VARARGS ) IF(NOT TPARM_TAKES_VARARGS) CHECK_CXX_SOURCE_COMPILES(" ${TPARM_INCLUDES} #define TPARM_VARARGS int main () { tparm( \"\" ); } " TPARM_TAKES_VARARGS_WITH_VARARGS ) IF(NOT TPARM_TAKES_VARARGS) SET(TPARM_SOLARIS_KLUDGE 1) ELSE() SET(TPARM_VARARGS 1) ENDIF() ENDIF() CMAKE_POP_CHECK_STATE() # Work around the fact that cmake does not propagate the language standard flag into # the CHECK_CXX_SOURCE_COMPILES function. See CMake issue #16456. # Ensure we do this after the FIND_PACKAGE calls which use C, and will error on a C++ # standards flag. # Also see https://github.com/fish-shell/fish-shell/issues/5865 IF(NOT POLICY CMP0067) LIST(APPEND CMAKE_REQUIRED_FLAGS "${CMAKE_CXX${CMAKE_CXX_STANDARD}_EXTENSION_COMPILE_OPTION}") ENDIF() CHECK_CXX_SOURCE_COMPILES(" #include int main () { std::unique_ptr foo = std::make_unique(); } " HAVE_STD__MAKE_UNIQUE ) FIND_PROGRAM(SED sed) CHECK_CXX_SOURCE_COMPILES(" #include #include std::atomic x; int main() { return x; }" LIBATOMIC_NOT_NEEDED) IF (NOT LIBATOMIC_NOT_NEEDED) SET(ATOMIC_LIBRARY "atomic") ENDIF() fish-3.1.0/cmake/Docs.cmake000066400000000000000000000062461362100272700154260ustar00rootroot00000000000000FIND_PROGRAM(SPHINX_EXECUTABLE NAMES sphinx-build HINTS $ENV{SPHINX_DIR} PATH_SUFFIXES bin DOC "Sphinx documentation generator") INCLUDE(FeatureSummary) SET(SPHINX_SRC_DIR "${CMAKE_CURRENT_SOURCE_DIR}/sphinx_doc_src") SET(SPHINX_ROOT_DIR "${CMAKE_CURRENT_BINARY_DIR}/user_doc") SET(SPHINX_BUILD_DIR "${SPHINX_ROOT_DIR}/build") SET(SPHINX_CACHE_DIR "${SPHINX_ROOT_DIR}/doctrees") SET(SPHINX_HTML_DIR "${SPHINX_ROOT_DIR}/html") SET(SPHINX_MANPAGE_DIR "${SPHINX_ROOT_DIR}/man") # sphinx-docs uses fish_indent for highlighting. # Prepend the output dir of fish_indent to PATH. ADD_CUSTOM_TARGET(sphinx-docs mkdir -p ${SPHINX_HTML_DIR}/_static/ COMMAND ${CMAKE_COMMAND} -E copy_if_different ${SPHINX_SRC_DIR}/_static/pygments.css ${SPHINX_HTML_DIR}/_static/ COMMAND ${CMAKE_COMMAND} -E copy_if_different ${SPHINX_SRC_DIR}/_static/custom.css ${SPHINX_HTML_DIR}/_static/ COMMAND env PATH="$:$$PATH" ${SPHINX_EXECUTABLE} -q -b html -c "${SPHINX_SRC_DIR}" -d "${SPHINX_CACHE_DIR}" "${SPHINX_SRC_DIR}" "${SPHINX_HTML_DIR}" DEPENDS sphinx_doc_src/fish_indent_lexer.py fish_indent COMMENT "Building HTML documentation with Sphinx") # sphinx-manpages needs the fish_indent binary for the version number ADD_CUSTOM_TARGET(sphinx-manpages env PATH="$:$$PATH" ${SPHINX_EXECUTABLE} -q -b man -c "${SPHINX_SRC_DIR}" -d "${SPHINX_CACHE_DIR}" "${SPHINX_SRC_DIR}" # TODO: This only works if we only have section 1 manpages. "${SPHINX_MANPAGE_DIR}/man1" DEPENDS fish_indent COMMENT "Building man pages with Sphinx") IF(SPHINX_EXECUTABLE) OPTION(BUILD_DOCS "build documentation (requires Sphinx)" ON) ELSE(SPHINX_EXECUTABLE) OPTION(BUILD_DOCS "build documentation (requires Sphinx)" OFF) ENDIF(SPHINX_EXECUTABLE) IF(BUILD_DOCS AND NOT SPHINX_EXECUTABLE) MESSAGE(FATAL_ERROR "build documentation selected, but sphinx-build could not be found") ENDIF() IF(IS_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/user_doc/html AND IS_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/user_doc/man) SET(HAVE_PREBUILT_DOCS TRUE) ELSE() SET(HAVE_PREBUILT_DOCS FALSE) ENDIF() IF(BUILD_DOCS OR HAVE_PREBUILT_DOCS) SET(INSTALL_DOCS ON) ELSE() SET(INSTALL_DOCS OFF) ENDIF() ADD_FEATURE_INFO(Documentation INSTALL_DOCS "user manual and documentation") IF(BUILD_DOCS) CONFIGURE_FILE("${SPHINX_SRC_DIR}/conf.py" "${SPHINX_BUILD_DIR}/conf.py" @ONLY) ADD_CUSTOM_TARGET(doc ALL DEPENDS sphinx-docs sphinx-manpages) # Group docs targets into a DocsTargets folder SET_PROPERTY(TARGET doc sphinx-docs sphinx-manpages PROPERTY FOLDER cmake/DocTargets) ELSEIF(HAVE_PREBUILT_DOCS) IF(NOT CMAKE_CURRENT_SOURCE_DIR STREQUAL CMAKE_CURRENT_BINARY_DIR) # Out of tree build - link the prebuilt documentation to the build tree ADD_CUSTOM_TARGET(link_doc ALL) ADD_CUSTOM_COMMAND(TARGET link_doc COMMAND ${CMAKE_COMMAND} -E create_symlink ${CMAKE_CURRENT_SOURCE_DIR}/user_doc ${CMAKE_CURRENT_BINARY_DIR}/user_doc POST_BUILD) ENDIF() ENDIF(BUILD_DOCS) fish-3.1.0/cmake/Install.cmake000066400000000000000000000227441362100272700161450ustar00rootroot00000000000000# -DLOCALEDIR="${CMAKE_INSTALL_FULL_LOCALEDIR}" # -DPREFIX=L"${CMAKE_INSTALL_PREFIX}" # -DDATADIR=L"${CMAKE_INSTALL_FULL_DATADIR}" # -DSYSCONFDIR=L"${CMAKE_INSTALL_FULL_SYSCONFDIR}" # -DBINDIR=L"${CMAKE_INSTALL_FULL_BINDIR}" # -DDOCDIR=L"${CMAKE_INSTALL_FULL_DOCDIR}") SET(CMAKE_INSTALL_MESSAGE NEVER) SET(PROGRAMS fish fish_indent fish_key_reader) SET(prefix ${CMAKE_INSTALL_PREFIX}) SET(bindir ${CMAKE_INSTALL_BINDIR}) SET(sysconfdir ${CMAKE_INSTALL_SYSCONFDIR}) SET(mandir ${CMAKE_INSTALL_MANDIR}) SET(rel_datadir ${CMAKE_INSTALL_DATADIR}) SET(datadir ${CMAKE_INSTALL_FULL_DATADIR}) SET(docdir ${CMAKE_INSTALL_DOCDIR}) # Comment at the top of some .in files SET(configure_input "This file was generated from a corresponding .in file.\ DO NOT MANUALLY EDIT THIS FILE!") SET(extra_completionsdir /usr/local/share/fish/vendor_completions.d CACHE STRING "Path for extra completions") SET(extra_functionsdir /usr/local/share/fish/vendor_functions.d CACHE STRING "Path for extra functions") SET(extra_confdir /usr/local/share/fish/vendor_conf.d CACHE STRING "Path for extra configuration") # These are the man pages that go in system manpath; all manpages go in the fish-specific manpath. SET(MANUALS ${CMAKE_CURRENT_BINARY_DIR}/user_doc/man/man1/fish.1 ${CMAKE_CURRENT_BINARY_DIR}/user_doc/man/man1/fish_indent.1 ${CMAKE_CURRENT_BINARY_DIR}/user_doc/man/man1/fish_key_reader.1) # Determine which man page we don't want to install. # On OS X, don't install a man page for open, since we defeat fish's open # function on OS X. # On other operating systems, don't install a realpath man page, as they almost all have a realpath # command, while macOS does not. IF(${CMAKE_SYSTEM_NAME} MATCHES "Darwin") SET(CONDEMNED_PAGE "open.1") ELSE() SET(CONDEMNED_PAGE "realpath.1") ENDIF() # Define a function to help us create directories. FUNCTION(FISH_CREATE_DIRS) FOREACH(dir ${ARGV}) INSTALL(DIRECTORY DESTINATION ${dir}) ENDFOREACH(dir) ENDFUNCTION(FISH_CREATE_DIRS) FUNCTION(FISH_TRY_CREATE_DIRS) FOREACH(dir ${ARGV}) IF(NOT IS_ABSOLUTE ${dir}) SET(abs_dir "\$ENV{DESTDIR}\${CMAKE_INSTALL_PREFIX}/${dir}") ELSE() SET(abs_dir "\$ENV{DESTDIR}${dir}") ENDIF() INSTALL(SCRIPT CODE "EXECUTE_PROCESS(COMMAND mkdir -p ${abs_dir} OUTPUT_QUIET ERROR_QUIET) EXECUTE_PROCESS(COMMAND chmod 755 ${abs_dir} OUTPUT_QUIET ERROR_QUIET) ") ENDFOREACH() ENDFUNCTION(FISH_TRY_CREATE_DIRS) # $v $(INSTALL) -m 755 -d $(DESTDIR)$(bindir) # $v for i in $(PROGRAMS); do\ # $(INSTALL) -m 755 $$i $(DESTDIR)$(bindir);\ # echo " Installing $(bo)$$i$(sgr0)";\ # true ;\ # done; INSTALL(TARGETS ${PROGRAMS} PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE GROUP_READ GROUP_EXECUTE WORLD_READ WORLD_EXECUTE DESTINATION ${bindir}) # $v $(INSTALL) -m 755 -d $(DESTDIR)$(sysconfdir)/fish # $v $(INSTALL) -m 755 -d $(DESTDIR)$(sysconfdir)/fish/conf.d # $v $(INSTALL) -m 755 -d $(DESTDIR)$(sysconfdir)/fish/completions # $v $(INSTALL) -m 755 -d $(DESTDIR)$(sysconfdir)/fish/functions # $v $(INSTALL) -m 644 etc/config.fish $(DESTDIR)$(sysconfdir)/fish/ FISH_CREATE_DIRS(${sysconfdir}/fish/conf.d ${sysconfdir}/fish/completions ${sysconfdir}/fish/functions) INSTALL(FILES etc/config.fish DESTINATION ${sysconfdir}/fish/) FISH_CREATE_DIRS(${rel_datadir}/fish ${rel_datadir}/fish/completions ${rel_datadir}/fish/functions ${rel_datadir}/fish/groff ${rel_datadir}/fish/man/man1 ${rel_datadir}/fish/tools ${rel_datadir}/fish/tools/web_config ${rel_datadir}/fish/tools/web_config/js ${rel_datadir}/fish/tools/web_config/partials ${rel_datadir}/fish/tools/web_config/sample_prompts) # $v $(INSTALL) -m 644 share/config.fish $(DESTDIR)$(datadir)/fish/ # $v $(INSTALL) -m 644 share/__fish_build_paths.fish $(DESTDIR)$(datadir)/fish/ CONFIGURE_FILE(share/__fish_build_paths.fish.in share/__fish_build_paths.fish) INSTALL(FILES share/config.fish ${CMAKE_CURRENT_BINARY_DIR}/share/__fish_build_paths.fish DESTINATION ${rel_datadir}/fish) # $v $(INSTALL) -m 755 -d $(DESTDIR)$(datadir)/pkgconfig # @echo "Creating placeholder vendor/'extra_' directories" # -$v $(INSTALL) -m 755 -d $(DESTDIR)$(extra_completionsdir) # -$v $(INSTALL) -m 755 -d $(DESTDIR)$(extra_functionsdir) # -$v $(INSTALL) -m 755 -d $(DESTDIR)$(extra_confdir) # Create only the vendor directories inside the prefix (#5029 / #6508) FISH_CREATE_DIRS(${rel_datadir}/fish/vendor_completions.d ${rel_datadir}/fish/vendor_functions.d ${rel_datadir}/fish/vendor_conf.d) # @echo "Installing pkgconfig file" # $v $(INSTALL) -m 644 fish.pc $(DESTDIR)$(datadir)/pkgconfig FISH_TRY_CREATE_DIRS(${rel_datadir}/pkgconfig) CONFIGURE_FILE(fish.pc.in fish.pc.noversion) ADD_CUSTOM_COMMAND(OUTPUT fish.pc COMMAND sed '/Version/d' fish.pc.noversion > fish.pc COMMAND printf "Version: " >> fish.pc COMMAND sed 's/FISH_BUILD_VERSION=//\;s/\"//g' ${FBVF} >> fish.pc WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/${FBVF} ${CMAKE_CURRENT_BINARY_DIR}/fish.pc.noversion) ADD_CUSTOM_TARGET(build_fish_pc ALL DEPENDS fish.pc) INSTALL(FILES ${CMAKE_CURRENT_BINARY_DIR}/fish.pc DESTINATION ${rel_datadir}/pkgconfig) # @echo "Installing the $(bo)fish completion library$(sgr0)..."; # $v $(INSTALL) -m 644 $(COMPLETIONS_DIR_FILES:%='%') $(DESTDIR)$(datadir)/fish/completions/ INSTALL(DIRECTORY share/completions/ DESTINATION ${rel_datadir}/fish/completions FILES_MATCHING PATTERN "*.fish") # @echo "Installing $(bo)fish functions$(sgr0)"; # $v $(INSTALL) -m 644 $(FUNCTIONS_DIR_FILES:%='%') $(DESTDIR)$(datadir)/fish/functions/ INSTALL(DIRECTORY share/functions/ DESTINATION ${rel_datadir}/fish/functions FILES_MATCHING PATTERN "*.fish") # @echo "Installing $(bo)man pages$(sgr0)"; # $v $(INSTALL) -m 644 share/groff/* $(DESTDIR)$(datadir)/fish/groff/ INSTALL(DIRECTORY share/groff DESTINATION ${rel_datadir}/fish) # $v test -z "$(wildcard share/man/man1/*.1)" || $(INSTALL) -m 644 $(filter-out $(addprefix share/man/man1/, $(CONDEMNED_PAGES)), $(wildcard share/man/man1/*.1)) $(DESTDIR)$(datadir)/fish/man/man1/ # CONDEMNED_PAGE is managed by the conditional above # Building the man pages is optional: if sphinx isn't installed, they're not built INSTALL(DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/user_doc/man/man1/ DESTINATION ${rel_datadir}/fish/man/man1 FILES_MATCHING PATTERN "*.1" PATTERN ${CONDEMNED_PAGE} EXCLUDE) # @echo "Installing helper tools"; # $v $(INSTALL) -m 755 share/tools/*.py $(DESTDIR)$(datadir)/fish/tools/ INSTALL(PROGRAMS share/tools/create_manpage_completions.py share/tools/deroff.py DESTINATION ${rel_datadir}/fish/tools/) # $v $(INSTALL) -m 644 share/tools/web_config/*.* $(DESTDIR)$(datadir)/fish/tools/web_config/ # $v $(INSTALL) -m 644 share/tools/web_config/js/*.* $(DESTDIR)$(datadir)/fish/tools/web_config/js/ # $v $(INSTALL) -m 644 share/tools/web_config/partials/* $(DESTDIR)$(datadir)/fish/tools/web_config/partials/ # $v $(INSTALL) -m 644 share/tools/web_config/sample_prompts/*.fish $(DESTDIR)$(datadir)/fish/tools/web_config/sample_prompts/ # $v $(INSTALL) -m 755 share/tools/web_config/*.py $(DESTDIR)$(datadir)/fish/tools/web_config/ INSTALL(DIRECTORY share/tools/web_config DESTINATION ${rel_datadir}/fish/tools/ FILES_MATCHING PATTERN "*.png" PATTERN "*.css" PATTERN "*.html" PATTERN "*.py" PATTERN "*.js" PATTERN "*.fish") # @echo "Installing more man pages"; # $v $(INSTALL) -m 755 -d $(DESTDIR)$(mandir)/man1; # $v for i in $(MANUALS); do \ # $(INSTALL) -m 644 $$i $(DESTDIR)$(mandir)/man1/; \ # true; \ # done; # Building the man pages is optional: if Sphinx isn't installed, they're not built INSTALL(FILES ${MANUALS} DESTINATION ${mandir}/man1/ OPTIONAL) #install-doc: $(user_doc) # @echo "Installing online user documentation"; # $v $(INSTALL) -m 755 -d $(DESTDIR)$(docdir) # $v for i in user_doc/html/* CHANGELOG.md; do \ # if test -f $$i; then \ # $(INSTALL) -m 644 $$i $(DESTDIR)$(docdir); \ # fi; \ # done; # Building the manual is optional INSTALL(DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/user_doc/html/ # Trailing slash is important! DESTINATION ${docdir} OPTIONAL) INSTALL(FILES CHANGELOG.md DESTINATION ${docdir}) # $v $(INSTALL) -m 644 share/lynx.lss $(DESTDIR)$(datadir)/fish/ INSTALL(FILES share/lynx.lss DESTINATION ${rel_datadir}/fish/) # These files are built by cmake/gettext.cmake, but using GETTEXT_PROCESS_PO_FILES's # INSTALL_DESTINATION leads to them being installed as ${lang}.gmo, not fish.mo # The ${languages} array comes from cmake/gettext.cmake IF(GETTEXT_FOUND) FOREACH(lang ${languages}) INSTALL(FILES ${CMAKE_CURRENT_BINARY_DIR}/${lang}.gmo DESTINATION ${CMAKE_INSTALL_LOCALEDIR}/${lang}/LC_MESSAGES/ RENAME fish.mo) ENDFOREACH() ENDIF() # Group install targets into a InstallTargets folder SET_PROPERTY(TARGET build_fish_pc CHECK-FISH-BUILD-VERSION-FILE test_fishscript test_prep tests_buildroot_target PROPERTY FOLDER cmake/InstallTargets) # Make a target build_root that installs into the buildroot directory, for testing. SET(BUILDROOT_DIR ${CMAKE_CURRENT_BINARY_DIR}/buildroot) ADD_CUSTOM_TARGET(build_root COMMAND DESTDIR=${BUILDROOT_DIR} ${CMAKE_COMMAND} --build ${CMAKE_CURRENT_BINARY_DIR} --target install) fish-3.1.0/cmake/MacApp.cmake000066400000000000000000000041101362100272700156630ustar00rootroot00000000000000# This is Mac-only. if (NOT APPLE) RETURN() endif (NOT APPLE) # The source tree containing certain macOS resources. SET(OSX_DIR ${CMAKE_CURRENT_SOURCE_DIR}/osx) SET(RESOURCE_FILES ${OSX_DIR}/launch_fish.scpt ${OSX_DIR}/fish_term_icon.icns ${CMAKE_CURRENT_SOURCE_DIR}/build_tools/osx_package_scripts/add-shell ${OSX_DIR}/install.sh ) # Resource files must be present in the source list. ADD_EXECUTABLE(fish_macapp EXCLUDE_FROM_ALL ${OSX_DIR}/osx_fish_launcher.m ${RESOURCE_FILES} ) # Compute the version. Note this is done at generation time, not build time, # so cmake must be re-run after version changes for the app to be updated. But # generally this will be run by make_pkg.sh which always re-runs cmake. EXECUTE_PROCESS( COMMAND ${CMAKE_CURRENT_SOURCE_DIR}/build_tools/git_version_gen.sh --stdout COMMAND cut -d- -f1 OUTPUT_VARIABLE FISH_SHORT_VERSION OUTPUT_STRIP_TRAILING_WHITESPACE) # Note CMake appends .app, so the real output name will be fish.app. # This target does not include the 'base' resource. SET_TARGET_PROPERTIES(fish_macapp PROPERTIES OUTPUT_NAME "fish") FIND_LIBRARY(FOUNDATION_LIB Foundation) TARGET_LINK_LIBRARIES(fish_macapp ${FOUNDATION_LIB}) SET_TARGET_PROPERTIES(fish_macapp PROPERTIES MACOSX_BUNDLE TRUE MACOSX_BUNDLE_INFO_PLIST ${OSX_DIR}/CMakeMacAppInfo.plist.in MACOSX_BUNDLE_GUI_IDENTIFIER "com.ridiculousfish.fish-shell" MACOSX_BUNDLE_SHORT_VERSION_STRING ${FISH_SHORT_VERSION} RESOURCE "${RESOURCE_FILES}" ) # The fish Mac app contains a fish installation inside the package. # Here is where it gets built. # Copy into the fish mac app after. SET(MACAPP_FISH_BUILDROOT ${CMAKE_CURRENT_BINARY_DIR}/macapp_buildroot/base) ADD_CUSTOM_COMMAND(TARGET fish_macapp POST_BUILD COMMAND ${CMAKE_COMMAND} -E make_directory ${MACAPP_FISH_BUILDROOT} COMMAND DESTDIR=${MACAPP_FISH_BUILDROOT} ${CMAKE_COMMAND} --build ${CMAKE_CURRENT_BINARY_DIR} --target install COMMAND ${CMAKE_COMMAND} -E copy_directory ${MACAPP_FISH_BUILDROOT}/.. $/Resources/ ) fish-3.1.0/cmake/PCRE2.cmake000066400000000000000000000015301362100272700153400ustar00rootroot00000000000000# PCRE2 needs some settings. SET(PCRE2_WIDTH ${WCHAR_T_BITS}) SET(PCRE2_BUILD_PCRE2_8 OFF CACHE BOOL "Build 8bit PCRE2 library") SET(PCRE2_BUILD_PCRE2_${PCRE2_WIDTH} ON CACHE BOOL "Build ${PCRE2_WIDTH}bit PCRE2 library") SET(PCRE2_SHOW_REPORT OFF CACHE BOOL "Show the final configuration report") SET(PCRE2_BUILD_PCRE2GREP OFF CACHE BOOL "Build pcre2grep") SET(PCRE2_MIN_VERSION 10.21) FIND_LIBRARY(PCRE2_LIB pcre2-${PCRE2_WIDTH}) FIND_PATH(PCRE2_INCLUDE_DIR pcre2.h) IF (PCRE2_LIB AND PCRE2_INCLUDE_DIR) MESSAGE(STATUS "Found system PCRE2 library ${PCRE2_INCLUDE_DIR}") ELSE() MESSAGE(STATUS "Using bundled PCRE2 library") ADD_SUBDIRECTORY(pcre2-10.32 EXCLUDE_FROM_ALL) SET(PCRE2_INCLUDE_DIR ${CMAKE_BINARY_DIR}/pcre2-10.32/) SET(PCRE2_LIB pcre2-${PCRE2_WIDTH}) endif(PCRE2_LIB AND PCRE2_INCLUDE_DIR) INCLUDE_DIRECTORIES(${PCRE2_INCLUDE_DIR}) fish-3.1.0/cmake/Tests.cmake000066400000000000000000000112241362100272700156300ustar00rootroot00000000000000# Define fish_tests. ADD_EXECUTABLE(fish_tests EXCLUDE_FROM_ALL src/fish_tests.cpp) FISH_LINK_DEPS(fish_tests) # The "test" directory. SET(TEST_DIR ${CMAKE_CURRENT_BINARY_DIR}/test) # The directory into which fish is installed. SET(TEST_INSTALL_DIR ${TEST_DIR}/buildroot) # The directory where the tests expect to find the fish root (./bin, etc) SET(TEST_ROOT_DIR ${TEST_DIR}/root) # Copy tests files. FILE(GLOB TESTS_FILES tests/*) ADD_CUSTOM_TARGET(tests_dir DEPENDS tests) IF(NOT FISH_IN_TREE_BUILD) ADD_CUSTOM_COMMAND(TARGET tests_dir COMMAND ${CMAKE_COMMAND} -E copy_directory ${CMAKE_SOURCE_DIR}/tests/ ${CMAKE_BINARY_DIR}/tests/ COMMENT "Copying test files to binary dir" VERBATIM) ADD_DEPENDENCIES(fish_tests tests_dir) ENDIF() # Copy littlecheck.py CONFIGURE_FILE(build_tools/littlecheck.py littlecheck.py COPYONLY) # Make the directory in which to run tests. # Also symlink fish to where the tests expect it to be. # Lastly put fish_test_helper there too. ADD_CUSTOM_TARGET(tests_buildroot_target COMMAND ${CMAKE_COMMAND} -E make_directory ${TEST_INSTALL_DIR} COMMAND DESTDIR=${TEST_INSTALL_DIR} ${CMAKE_COMMAND} --build ${CMAKE_CURRENT_BINARY_DIR} --target install COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_BINARY_DIR}/fish_test_helper ${TEST_INSTALL_DIR}/${CMAKE_INSTALL_PREFIX}/bin COMMAND ${CMAKE_COMMAND} -E create_symlink ${TEST_INSTALL_DIR}/${CMAKE_INSTALL_PREFIX} ${TEST_ROOT_DIR} DEPENDS fish fish_test_helper) IF(NOT FISH_IN_TREE_BUILD) # We need to symlink share/functions for the tests. # This should be simplified. ADD_CUSTOM_TARGET(symlink_functions COMMAND ${CMAKE_COMMAND} -E create_symlink ${CMAKE_CURRENT_SOURCE_DIR}/share/functions ${CMAKE_CURRENT_BINARY_DIR}/share/functions) ADD_DEPENDENCIES(tests_buildroot_target symlink_functions) ELSE() ADD_CUSTOM_TARGET(symlink_functions) ENDIF() # Prep the environment for running the unit tests. ADD_CUSTOM_TARGET(test_prep COMMAND ${CMAKE_COMMAND} -E remove_directory ${TEST_DIR}/data COMMAND ${CMAKE_COMMAND} -E remove_directory ${TEST_DIR}/home COMMAND ${CMAKE_COMMAND} -E remove_directory ${TEST_DIR}/temp COMMAND ${CMAKE_COMMAND} -E make_directory ${TEST_DIR}/data ${TEST_DIR}/home ${TEST_DIR}/temp DEPENDS tests_buildroot_target tests_dir USES_TERMINAL) # Define our individual tests. # Each test is conceptually independent. # However when running all tests, we want to run them serially for sanity's sake. # So define both a normal target, and a serial variant which enforces ordering. FOREACH(TESTTYPE test serial_test) ADD_CUSTOM_TARGET(${TESTTYPE}_low_level COMMAND env XDG_DATA_HOME=test/data XDG_CONFIG_HOME=test/home ./fish_tests WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} DEPENDS fish_tests USES_TERMINAL) ADD_CUSTOM_TARGET(${TESTTYPE}_fishscript COMMAND cd tests && ${TEST_ROOT_DIR}/bin/fish test.fish DEPENDS test_prep USES_TERMINAL) ADD_CUSTOM_TARGET(${TESTTYPE}_interactive COMMAND cd tests && ${TEST_ROOT_DIR}/bin/fish interactive.fish DEPENDS test_prep USES_TERMINAL) ENDFOREACH(TESTTYPE) # Now add a dependency chain between the serial versions. # This ensures they run in order. ADD_DEPENDENCIES(serial_test_fishscript serial_test_low_level) ADD_DEPENDENCIES(serial_test_interactive serial_test_fishscript) ADD_CUSTOM_TARGET(serial_test_high_level DEPENDS serial_test_interactive serial_test_fishscript) # Create the 'test' target. # Set a policy so CMake stops complaining about the name 'test'. CMAKE_POLICY(PUSH) IF(${CMAKE_VERSION} VERSION_LESS 3.11.0 AND POLICY CMP0037) CMAKE_POLICY(SET CMP0037 OLD) ENDIF() ADD_CUSTOM_TARGET(test) CMAKE_POLICY(POP) ADD_DEPENDENCIES(test serial_test_high_level) # Group test targets into a TestTargets folder SET_PROPERTY(TARGET test tests_dir test_low_level test_fishscript test_interactive test_fishscript test_prep tests_buildroot_target serial_test_high_level serial_test_low_level serial_test_fishscript serial_test_interactive symlink_functions PROPERTY FOLDER cmake/TestTargets) fish-3.1.0/cmake/Version.cmake000066400000000000000000000051711362100272700161570ustar00rootroot00000000000000# This file adds commands to manage the FISH-BUILD-VERSION-FILE (hereafter # FBVF). This file exists in the build directory and is used to populate the # documentation and also the version string in fish_version.o (printed with # `echo $version` and also fish --version). The essential idea is that we are # going to invoke git_version_gen.sh, which will update the # FISH-BUILD-VERSION-FILE only if it needs to change; this is what makes # incremental rebuilds fast. # # This code is delicate, with the chief subtlety revolving around Ninja. A # natural and naive approach would tell the generated build system that FBVF is # a dependency of fish_version.o, and that git_version_gen.sh updates it. Make # will then invoke the script, check the timestamp on fish_version.o and FBVF, # see that FBVF is earlier, and then not rebuild fish_version.o. Ninja, # however, decides what to build up-front and will unconditionally rebuild # fish_version.o. # # To avoid this with Ninja, we want to hook into its 'restat' option which we # can do through the BYPRODUCTS feature of CMake. See # https://cmake.org/cmake/help/latest/policy/CMP0058.html # # Unfortunately BYPRODUCTS behaves strangely with the Makefile generator: it # marks FBVF as generated and then CMake itself will `touch` it on every build, # meaning that using BYPRODUCTS will cause fish_version.o to be rebuilt # unconditionally with the Makefile generator. Thus we want to use the # natural-and-naive approach for Makefiles. # **IMPORTANT** If you touch these build rules, please test both Ninja and # Makefile generators with both a clean and dirty git tree. Verify that both # generated build systems rebuild fish when the git tree goes from dirty to # clean (and vice versa), and verify they do NOT rebuild it when the git tree # stays the same (incremental builds must be fast). # Just a handy abbreviation. SET(FBVF FISH-BUILD-VERSION-FILE) # TODO: find a cleaner way to do this. IF (${CMAKE_GENERATOR} STREQUAL Ninja) SET(FBVF-OUTPUT fish-build-version-witness.txt) SET(CFBVF-BYPRODUCTS ${FBVF}) ELSE(${CMAKE_GENERATOR} STREQUAL Ninja) SET(FBVF-OUTPUT ${FBVF}) SET(CFBVF-BYPRODUCTS) ENDIF(${CMAKE_GENERATOR} STREQUAL Ninja) # Set up the version targets ADD_CUSTOM_TARGET(CHECK-FISH-BUILD-VERSION-FILE COMMAND ${CMAKE_CURRENT_SOURCE_DIR}/build_tools/git_version_gen.sh ${CMAKE_CURRENT_BINARY_DIR} WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} BYPRODUCTS ${CFBVF-BYPRODUCTS}) ADD_CUSTOM_COMMAND(OUTPUT ${FBVF-OUTPUT} DEPENDS CHECK-FISH-BUILD-VERSION-FILE) # Abbreviation for the target. SET(CFBVF CHECK-FISH-BUILD-VERSION-FILE) fish-3.1.0/cmake/gettext.cmake000066400000000000000000000024001362100272700162060ustar00rootroot00000000000000SET(languages de en fr nb nn pl pt_BR sv zh_CN) INCLUDE(FeatureSummary) OPTION(WITH_GETTEXT "translate messages if gettext is available" ON) IF(WITH_GETTEXT) FIND_PACKAGE(Intl) FIND_PACKAGE(Gettext) IF(GETTEXT_FOUND) SET(HAVE_GETTEXT 1) INCLUDE_DIRECTORIES(${Intl_INCLUDE_DIR}) ENDIF() ENDIF() ADD_FEATURE_INFO(gettext GETTEXT_FOUND "translate messages with gettext") # Define translations IF(GETTEXT_FOUND) FOREACH(lang ${languages}) # Our translations aren't set up entirely as CMake expects, so installation is done in # cmake/Install.cmake instead of using INSTALL_DESTINATION GETTEXT_PROCESS_PO_FILES(${lang} ALL PO_FILES po/${lang}.po) ENDFOREACH() ENDIF() CMAKE_PUSH_CHECK_STATE() SET(CMAKE_REQUIRED_INCLUDES ${CMAKE_REQUIRED_INCLUDES} ${Intl_INCLUDE_DIR}) SET(CMAKE_REQUIRED_LIBRARIES ${CMAKE_REQUIRED_LIBRARIES} ${Intl_LIBRARIES}) # libintl.h can be compiled into the stdlib on some GLibC systems IF(Intl_FOUND AND Intl_LIBRARIES) SET(LIBINTL_INCLUDE "#include ") ENDIF() CHECK_CXX_SOURCE_COMPILES(" ${LIBINTL_INCLUDE} #include int main () { extern int _nl_msg_cat_cntr; int tmp = _nl_msg_cat_cntr; exit(tmp); } " HAVE__NL_MSG_CAT_CNTR) CMAKE_POP_CHECK_STATE() fish-3.1.0/config_cmake.h.in000066400000000000000000000121021362100272700156230ustar00rootroot00000000000000/* Define to 1 if you have the `backtrace_symbols' function. */ #cmakedefine HAVE_BACKTRACE_SYMBOLS 1 /* Define to 1 if compiled on WSL */ #cmakedefine WSL 1 /* Define to 1 if you have the `clock_gettime' function. */ #cmakedefine HAVE_CLOCK_GETTIME 1 /* Define to 1 if you have the `ctermid_r' function. */ #cmakedefine HAVE_CTERMID_R 1 /* Define to 1 if you have the `dirfd' function. */ #cmakedefine HAVE_DIRFD 1 /* Define to 1 if you have the header file. */ #cmakedefine HAVE_EXECINFO_H 1 /* Define to 1 if you have the `flock' function. */ #cmakedefine HAVE_FLOCK 1 /* Define to 1 if you have the `futimens' function. */ #cmakedefine HAVE_FUTIMENS 1 /* Define to 1 if you have the `futimes' function. */ #cmakedefine HAVE_FUTIMES 1 /* Define to 1 if you have the `getifaddrs' function. */ #cmakedefine HAVE_GETIFADDRS 1 /* Define to 1 if you have the `getpwent' function. */ #cmakedefine HAVE_GETPWENT 1 /* Define to 1 if you have the 'getrusage' function. */ #cmakedefine HAVE_GETRUSAGE 1 /* Define to 1 if you have the `gettext' function. */ #cmakedefine HAVE_GETTEXT 1 /* Define to 1 if you have the `killpg' function. */ #cmakedefine HAVE_KILLPG 1 /* Define to 1 if you have the `lrand48_r' function. */ #cmakedefine HAVE_LRAND48_R 1 /* Define to 1 if you have the `mkostemp' function. */ #cmakedefine HAVE_MKOSTEMP 1 /* Define to 1 if you have the header file. */ #cmakedefine HAVE_CURSES_H 1 /* Define to 1 if you have the header file. */ #cmakedefine HAVE_NCURSES_CURSES_H 1 /* Define to 1 if you have the header file. */ #cmakedefine HAVE_NCURSES_H 1 /* Define to 1 if you have the header file. */ #cmakedefine HAVE_NCURSES_TERM_H 1 /* Define to 1 if you have the header file. */ #cmakedefine HAVE_SIGINFO_H 1 /* Define to 1 if you have the header file. */ #cmakedefine HAVE_SPAWN_H 1 /* Define to 1 if you have the `std::wcscasecmp' function. */ #cmakedefine HAVE_STD__WCSCASECMP 1 /* Define to 1 if you have the `std::wcsdup' function. */ #cmakedefine HAVE_STD__WCSDUP 1 /* Define to 1 if you have the `std::wcsncasecmp' function. */ #cmakedefine HAVE_STD__WCSNCASECMP 1 /* Define to 1 if `d_type' is a member of `struct dirent'. */ #cmakedefine HAVE_STRUCT_DIRENT_D_TYPE 1 /* Define to 1 if `st_ctime_nsec' is a member of `struct stat'. */ #cmakedefine HAVE_STRUCT_STAT_ST_CTIME_NSEC 1 /* Define to 1 if `st_mtimespec.tv_nsec' is a member of `struct stat'. */ #cmakedefine HAVE_STRUCT_STAT_ST_MTIMESPEC_TV_NSEC 1 /* Define to 1 if `st_mtim.tv_nsec' is a member of `struct stat'. */ #cmakedefine HAVE_STRUCT_STAT_ST_MTIM_TV_NSEC 1 /* Define to 1 if the sys_errlist array is available. */ #cmakedefine HAVE_SYS_ERRLIST 1 /* Define to 1 if you have the header file. */ #cmakedefine HAVE_SYS_IOCTL_H 1 /* Define to 1 if you have the header file. */ #cmakedefine HAVE_SYS_SELECT_H 1 /* Define to 1 if you have the header file. */ #cmakedefine HAVE_SYS_SYSCTL_H 1 /* Define to 1 if you have the header file. */ #cmakedefine HAVE_TERMIOS_H 1 /* Define to 1 if you have the header file. */ #cmakedefine HAVE_TERM_H 1 /* Define to 1 if you have the `wcscasecmp' function. */ #cmakedefine HAVE_WCSCASECMP 1 /* Define to 1 if you have the `wcsdup' function. */ #cmakedefine HAVE_WCSDUP 1 /* Define to 1 if you have the `wcslcpy' function. */ #cmakedefine HAVE_WCSLCPY 1 /* Define to 1 if you have the `wcsncasecmp' function. */ #cmakedefine HAVE_WCSNCASECMP 1 /* Define to 1 if you have the `wcsndup' function. */ #cmakedefine HAVE_WCSNDUP 1 /* Define to 1 if you have the `wcstod_l' function. */ #cmakedefine HAVE_WCSTOD_L 1 /* Define to 1 if the winsize struct and TIOCGWINSZ macro exist */ #cmakedefine HAVE_WINSIZE 1 /* Define to 1 if the _nl_msg_cat_cntr symbol is exported. */ #cmakedefine HAVE__NL_MSG_CAT_CNTR 1 /* Define to 1 if std::make_unique is available. */ #cmakedefine HAVE_STD__MAKE_UNIQUE 1 /* Define to 1 if the _sys_errs array is available. */ #cmakedefine HAVE__SYS__ERRS 1 /* Define to 1 to disable ncurses macros that conflict with the STL */ #define NCURSES_NOMACROS 1 /* Define to 1 to disable curses macros that conflict with the STL */ #define NOMACROS 1 /* Define to the address where bug reports for this package should be sent. */ #define PACKAGE_BUGREPORT "https://github.com/fish-shell/fish-shell/issues" /* Define to the full name of this package. */ #define PACKAGE_NAME "fish" /* Define to 1 if tparm accepts a fixed amount of parameters. */ #cmakedefine TPARM_SOLARIS_KLUDGE 1 /* Enable GNU extensions on systems that have them. */ #ifndef _GNU_SOURCE # define _GNU_SOURCE 1 #endif /* The size of wchar_t in bits. */ #define WCHAR_T_BITS ${WCHAR_T_BITS} /* Define if xlocale.h is required for locale_t or wide character support */ #cmakedefine HAVE_XLOCALE_H 1 /* Enable large inode numbers on Mac OS X 10.5. */ #ifndef _DARWIN_USE_64_BIT_INODE # define _DARWIN_USE_64_BIT_INODE 1 #endif #if __GNUC__ >= 3 #ifndef __warn_unused #define __warn_unused __attribute__ ((warn_unused_result)) #endif #else #define __warn_unused #endif fish-3.1.0/etc/000077500000000000000000000000001362100272700132175ustar00rootroot00000000000000fish-3.1.0/etc/config.fish000066400000000000000000000006551362100272700153450ustar00rootroot00000000000000# Put system-wide fish configuration entries here # or in .fish files in conf.d/ # Files in conf.d can be overridden by the user # by files with the same name in $XDG_CONFIG_HOME/fish/conf.d # This file is run by all fish instances. # To include configuration only for login shells, use # if status --is-login # ... # end # To include configuration only for interactive shells, use # if status --is-interactive # ... # end fish-3.1.0/fish.desktop000066400000000000000000000005221362100272700147670ustar00rootroot00000000000000[Desktop Entry] Encoding=UTF-8 Version=1.0 Type=Application Terminal=true # This file is for use in appimages, which rewrite the path. # Other uses would have to replace these with the correct path. Exec=fish Name=fish Icon=fish # "Shell" would be the proper category, but it's reserved so we can't use it. Categories=ConsoleOnly;System; fish-3.1.0/fish.pc.in000066400000000000000000000003721362100272700143300ustar00rootroot00000000000000prefix=@prefix@ datadir=@datadir@ completionsdir=@extra_completionsdir@ functionsdir=@extra_functionsdir@ confdir=@extra_confdir@ Name: fish Description: fish, the friendly interactive shell URL: https://fishshell.com/ Version: @fish_build_version@ fish-3.1.0/fish.png000066400000000000000000000203571362100272700141120ustar00rootroot00000000000000PNG  IHDR"wPLTELiq///@@@YYYwwwpppiiiQQQFFF£001KKK ,++999CCC&'(455===;;;.1.3h.0=3.O0//505lU0TD0l3ȁ5y526e16ͯ/00ً825پ40&tRNS -AjXv,"IDATx 'Ƞ6w̕r8 ExPB}m Whҁ Yigd%WáDKq6 l{= ]pU'?0 # 1 <. }(~P MBAIN͊Ni"/]Ob`=L(Q( y8ݙ&o(sJGjqá&yӭ֘''XPPJ %%+Bi̡4mٟ@X| 5—/^9u#zN 1 0R}CK9nlt݅p0'V 5bsc^1I[@ &69vL Pg9;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(L(S$n&F&IYdSlOI_nJIuS:ϾLS_f&h ?=6ESq/]=ȩ`$W*]q$ғԤ&]w ;\έest_2'&g;)w}w@ ҍG~%SN my~2r7subbȭHdQ @;I΋x@n-"-;6"C8wlګ0cE"?n  'q;;/L:֥?<ί7u֓ aaa]Wa"/s_sh|oosneŘp$;\v7y?jEIK W\NsD0PP!i*·3{p HjO2Rᤑ$@3>@2Y!KiqDCYXbd(~!4X`쌑 YI{y !{ pģD5t Abc(ل EBtr`b(&<`eڍN\"|Oz͑ҝzg.0=/IENDB`fish-3.1.0/fish.spec.in000066400000000000000000000055251362100272700146650ustar00rootroot00000000000000Summary: Friendly interactive shell Name: fish Version: @RPMVERSION@ Release: 0.%{?dist} License: GPL-2.0 Group: System/Shells URL: https://fishshell.com/ Source0: %{name}_@VERSION@.orig.tar.gz BuildRequires: ncurses-devel gettext gcc-c++ autoconf %if 0%{?rhel} && 0%{?rhel} < 8 BuildRequires: cmake3 %else BuildRequires: cmake pcre2-devel %endif %if 0%{?opensuse_bs} && 0%{?rhel} && 0%{?rhel} < 7 BuildRequires: gcc48 gcc48-c++ python-argparse %endif # for tests %if 0%{?fedora} || 0%{?rhel} && 0%{?rhel} > 7 # Need the en_US.utf-8 locale at a minimum BuildRequires: glibc-langpack-en %endif %if 0%{?rhel} && 0%{?rhel} > 7 BuildRequires: python3 %endif BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) Requires: python Requires: man %description fish is a shell geared towards interactive use. Its features are focused on user friendliness and discoverability. The language syntax is simple but incompatible with other shell languages. %prep %setup -q -n %{name}-@VERSION@ %build %if 0%{?opensuse_bs} && 0%{?rhel} && 0%{?rhel} < 7 export CC=gcc48 export CXX=g++48 EXTRA_CMAKE_FLAGS="-DCURSES_EXTRA_LIBRARY=tinfo" %endif # CMake macros define -DBUILD_SHARED_LIBS:BOOL=ON, which breaks the # bundled PCRE2 static library. EXTRA_CMAKE_FLAGS="$EXTRA_CMAKE_FLAGS -DBUILD_SHARED_LIBS:BOOL=OFF" # CMake macros define the wrong sysconfdir arguments EXTRA_CMAKE_FLAGS="$EXTRA_CMAKE_FLAGS -DCMAKE_INSTALL_SYSCONFDIR=%{_sysconfdir}" %if 0%{?rhel} && 0%{?rhel} < 8 %cmake3 $EXTRA_CMAKE_FLAGS %else %cmake $EXTRA_CMAKE_FLAGS %endif %if 0%{?make_jobs:1} %make_jobs %else make %{?_smp_mflags} %endif %install %if 0%{?cmake_install:1} %cmake_install %else %make_install %endif %find_lang %{name} %check # OpenSUSE does out-of-tree builds and defines __builddir %if 0%{?__builddir:1} cd %__builddir %endif make test SHOW_INTERACTIVE_LOG=1 %clean rm -rf $RPM_BUILD_ROOT %post # Add fish to the list of allowed shells in /etc/shells if ! grep %{_bindir}/fish %{_sysconfdir}/shells >/dev/null; then echo %{_bindir}/fish >>%{_sysconfdir}/shells fi %postun # Remove fish from the list of allowed shells in /etc/shells if [ "$1" = 0 ]; then grep -v %{_bindir}/fish %{_sysconfdir}/shells >%{_sysconfdir}/fish.tmp mv %{_sysconfdir}/fish.tmp %{_sysconfdir}/shells fi %files -f %{name}.lang %defattr(-,root,root,-) # The documentation directory %docdir %{_datadir}/doc/fish/ %{_datadir}/doc/fish/ # man files %{_mandir}/man1/* %docdir %{_datadir}/fish/man/man1/ %{_datadir}/fish/man/man1/ # The program binaries %attr(0755,root,root) %{_bindir}/* # Configuration files %dir %{_sysconfdir}/fish/ %config(noreplace) %{_sysconfdir}/fish/config.fish # Support files %{_datadir}/fish/ # pkgconfig %{_datadir}/pkgconfig/fish.pc fish-3.1.0/osx/000077500000000000000000000000001362100272700132555ustar00rootroot00000000000000fish-3.1.0/osx/CMakeMacAppInfo.plist.in000066400000000000000000000022731362100272700176210ustar00rootroot00000000000000 CFBundleDisplayName fish shell CFBundleExecutable ${MACOSX_BUNDLE_EXECUTABLE_NAME} CFBundleIconFile fish_term_icon CFBundleIdentifier ${MACOSX_BUNDLE_GUI_IDENTIFIER} CFBundleInfoDictionaryVersion 6.0 CFBundleName fish shell CFBundlePackageType APPL CFBundleShortVersionString ${MACOSX_BUNDLE_SHORT_VERSION_STRING} CFBundleVersion 0.1 LSApplicationCategoryType public.app-category.productivity LSMinimumSystemVersion 10.6 NSAppleEventsUsageDescription A Terminal window with the fish shell running in it will be opened. LSUIElement NSHumanReadableCopyright Copyright © 2012, ridiculous_fish All rights reserved. fish-3.1.0/osx/fish_term_icon.icns000066400000000000000000010265461362100272700171410ustar00rootroot00000000000000icns-fTOC Hic09Qic08it32e|t8mk@il32 l8mkis32s8mkic09QPNG  IHDRxsRGB pHYs  YiTXtXML:com.adobe.xmp 1 L'Y@IDATxIeIv!<#cnj9#Z ϠUK+~ j%ZpEQH\P h4E-ZH"٭f23}x}?ψp>3;vرsڱ&&ihhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhH ;gH jMMMMU;5oh;!74k&&&&H>(o<&['p<_sZ\[^FΨv KaiaiG].IIII`w%0NlGa';NOOFx^/.ޥ<6 4 4 4 FuɨԀpgLWCC\Гar@6׏csfx2$$$$~/p8 xß~Çv3ϟOJRc?}tB&.n3޿=Eǻ/ƝQ ;o߾ޟw( y@1Ȇ Oڻfݜ5 4 4 = ÿ6V+T͡{(y r>运?yk --.-̖f_=k(u)lz(x+zS0(7(-:_ݾGɟŦҾ4#i仱=p0(4 4 4 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