mirror of
https://github.com/fish-shell/fish-shell.git
synced 2026-06-09 20:21:16 -03:00
Compare commits
13 Commits
3.0b1
...
Integratio
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
938ce48d25 | ||
|
|
0c25d7a49c | ||
|
|
d6e315d25d | ||
|
|
14ee19cc1b | ||
|
|
57d6124e6e | ||
|
|
cf2b40040a | ||
|
|
b404b9392c | ||
|
|
1f871c4d0c | ||
|
|
e07b45f447 | ||
|
|
081e14fd21 | ||
|
|
99ba07354a | ||
|
|
79d53a32dc | ||
|
|
ffab420e43 |
20
CHANGELOG.md
20
CHANGELOG.md
@@ -1,3 +1,21 @@
|
|||||||
|
# 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.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.
|
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.
|
||||||
@@ -57,7 +75,7 @@ A new feature flags mechanism is added for staging deprecations and breaking cha
|
|||||||
- `exec` prompts for confirmation if background jobs are running.
|
- `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).
|
- `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).
|
- `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)..
|
- `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.
|
- `jobs` has a new `--quiet` option to silence the output.
|
||||||
- `read` has a new `--delimiter` option for splitting input into arrays (#4256).
|
- `read` has a new `--delimiter` option for splitting input into arrays (#4256).
|
||||||
- `read` writes directly to stdout if called without arguments (#4407).
|
- `read` writes directly to stdout if called without arguments (#4407).
|
||||||
|
|||||||
@@ -72,6 +72,7 @@ CHECK_CXX_SYMBOL_EXISTS(wcsdup wchar.h HAVE_WCSDUP)
|
|||||||
CHECK_CXX_SYMBOL_EXISTS(wcslcpy wchar.h HAVE_WCSLCPY)
|
CHECK_CXX_SYMBOL_EXISTS(wcslcpy wchar.h HAVE_WCSLCPY)
|
||||||
CHECK_CXX_SYMBOL_EXISTS(wcsncasecmp wchar.h HAVE_WCSNCASECMP)
|
CHECK_CXX_SYMBOL_EXISTS(wcsncasecmp wchar.h HAVE_WCSNCASECMP)
|
||||||
CHECK_CXX_SYMBOL_EXISTS(wcsndup wchar.h HAVE_WCSNDUP)
|
CHECK_CXX_SYMBOL_EXISTS(wcsndup wchar.h HAVE_WCSNDUP)
|
||||||
|
CHECK_CXX_SYMBOL_EXISTS(wcstod_l wchar.h HAVE_WCSTOD_L)
|
||||||
|
|
||||||
CHECK_CXX_SYMBOL_EXISTS(_sys_errs stdlib.h HAVE__SYS__ERRS)
|
CHECK_CXX_SYMBOL_EXISTS(_sys_errs stdlib.h HAVE__SYS__ERRS)
|
||||||
|
|
||||||
|
|||||||
@@ -142,6 +142,11 @@
|
|||||||
/* Define to 1 if tparm accepts a fixed amount of paramters. */
|
/* Define to 1 if tparm accepts a fixed amount of paramters. */
|
||||||
#cmakedefine TPARM_SOLARIS_KLUDGE 1
|
#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. */
|
/* The size of wchar_t in bits. */
|
||||||
#define WCHAR_T_BITS ${WCHAR_T_BITS}
|
#define WCHAR_T_BITS ${WCHAR_T_BITS}
|
||||||
|
|
||||||
|
|||||||
@@ -316,6 +316,7 @@ AC_STRUCT_DIRENT_D_TYPE
|
|||||||
#
|
#
|
||||||
|
|
||||||
AC_CHECK_FUNCS( wcsndup )
|
AC_CHECK_FUNCS( wcsndup )
|
||||||
|
AC_CHECK_FUNCS( wcstod_l )
|
||||||
AC_CHECK_FUNCS( futimes )
|
AC_CHECK_FUNCS( futimes )
|
||||||
AC_CHECK_FUNCS( wcslcpy lrand48_r killpg )
|
AC_CHECK_FUNCS( wcslcpy lrand48_r killpg )
|
||||||
AC_CHECK_FUNCS( backtrace_symbols getifaddrs )
|
AC_CHECK_FUNCS( backtrace_symbols getifaddrs )
|
||||||
|
|||||||
@@ -17,7 +17,7 @@
|
|||||||
<key>CFBundlePackageType</key>
|
<key>CFBundlePackageType</key>
|
||||||
<string>APPL</string>
|
<string>APPL</string>
|
||||||
<key>CFBundleShortVersionString</key>
|
<key>CFBundleShortVersionString</key>
|
||||||
<string>2.7.900</string>
|
<string>3.0.0</string>
|
||||||
<key>CFBundleVersion</key>
|
<key>CFBundleVersion</key>
|
||||||
<string>0.1</string>
|
<string>0.1</string>
|
||||||
<key>LSApplicationCategoryType</key>
|
<key>LSApplicationCategoryType</key>
|
||||||
|
|||||||
@@ -206,7 +206,7 @@
|
|||||||
#define PACKAGE_NAME "fish"
|
#define PACKAGE_NAME "fish"
|
||||||
|
|
||||||
/* Define to the full name and version of this package. */
|
/* Define to the full name and version of this package. */
|
||||||
#define PACKAGE_STRING "fish 3.0b1"
|
#define PACKAGE_STRING "fish 3.0.0"
|
||||||
|
|
||||||
/* Define to the one symbol short name of this package. */
|
/* Define to the one symbol short name of this package. */
|
||||||
#define PACKAGE_TARNAME "fish"
|
#define PACKAGE_TARNAME "fish"
|
||||||
@@ -215,7 +215,7 @@
|
|||||||
#define PACKAGE_URL ""
|
#define PACKAGE_URL ""
|
||||||
|
|
||||||
/* Define to the version of this package. */
|
/* Define to the version of this package. */
|
||||||
#define PACKAGE_VERSION "3.0b1"
|
#define PACKAGE_VERSION "3.0.0"
|
||||||
|
|
||||||
/* The size of `wchar_t', as computed by sizeof. */
|
/* The size of `wchar_t', as computed by sizeof. */
|
||||||
#define SIZEOF_WCHAR_T 4
|
#define SIZEOF_WCHAR_T 4
|
||||||
|
|||||||
@@ -17,11 +17,6 @@ function fish_vi_key_bindings --description 'vi-like key bindings for fish'
|
|||||||
bind --erase --all --preset # clear earlier bindings, if any
|
bind --erase --all --preset # clear earlier bindings, if any
|
||||||
end
|
end
|
||||||
|
|
||||||
# Silence warnings about unavailable keys. See #4431, 4188
|
|
||||||
if not contains -- -s $argv
|
|
||||||
set argv "-s" "-M" $argv
|
|
||||||
end
|
|
||||||
|
|
||||||
# Allow just calling this function to correctly set the bindings.
|
# Allow just calling this function to correctly set the bindings.
|
||||||
# Because it's a rather discoverable name, users will execute it
|
# Because it's a rather discoverable name, users will execute it
|
||||||
# and without this would then have subtly broken bindings.
|
# and without this would then have subtly broken bindings.
|
||||||
@@ -61,217 +56,217 @@ function fish_vi_key_bindings --description 'vi-like key bindings for fish'
|
|||||||
__fish_shared_key_bindings -M $mode
|
__fish_shared_key_bindings -M $mode
|
||||||
end
|
end
|
||||||
|
|
||||||
bind --preset $argv insert \r execute
|
bind -s --preset -M insert \r execute
|
||||||
bind --preset $argv insert \n execute
|
bind -s --preset -M insert \n execute
|
||||||
|
|
||||||
bind --preset $argv insert "" self-insert
|
bind -s --preset -M insert "" self-insert
|
||||||
|
|
||||||
# Add way to kill current command line while in insert mode.
|
# Add way to kill current command line while in insert mode.
|
||||||
bind --preset $argv insert \cc __fish_cancel_commandline
|
bind -s --preset -M insert \cc __fish_cancel_commandline
|
||||||
# Add a way to switch from insert to normal (command) mode.
|
# Add a way to switch from insert to normal (command) mode.
|
||||||
# Note if we are paging, we want to stay in insert mode
|
# Note if we are paging, we want to stay in insert mode
|
||||||
# See #2871
|
# See #2871
|
||||||
bind --preset $argv insert \e "if commandline -P; commandline -f cancel; else; set fish_bind_mode default; commandline -f backward-char force-repaint; end"
|
bind -s --preset -M insert \e "if commandline -P; commandline -f cancel; else; set fish_bind_mode default; commandline -f backward-char force-repaint; end"
|
||||||
|
|
||||||
# Default (command) mode
|
# Default (command) mode
|
||||||
bind --preset :q exit
|
bind -s --preset :q exit
|
||||||
bind --preset -m insert \cc __fish_cancel_commandline
|
bind -s --preset -m insert \cc __fish_cancel_commandline
|
||||||
bind --preset $argv default h backward-char
|
bind -s --preset -M default h backward-char
|
||||||
bind --preset $argv default l forward-char
|
bind -s --preset -M default l forward-char
|
||||||
bind --preset -m insert \n execute
|
bind -s --preset -m insert \n execute
|
||||||
bind --preset -m insert \r execute
|
bind -s --preset -m insert \r execute
|
||||||
bind --preset -m insert i force-repaint
|
bind -s --preset -m insert i force-repaint
|
||||||
bind --preset -m insert I beginning-of-line force-repaint
|
bind -s --preset -m insert I beginning-of-line force-repaint
|
||||||
bind --preset -m insert a forward-char force-repaint
|
bind -s --preset -m insert a forward-char force-repaint
|
||||||
bind --preset -m insert A end-of-line force-repaint
|
bind -s --preset -m insert A end-of-line force-repaint
|
||||||
bind --preset -m visual v begin-selection force-repaint
|
bind -s --preset -m visual v begin-selection force-repaint
|
||||||
|
|
||||||
#bind --preset -m insert o "commandline -a \n" down-line force-repaint
|
#bind -s --preset -m insert o "commandline -a \n" down-line force-repaint
|
||||||
#bind --preset -m insert O beginning-of-line "commandline -i \n" up-line force-repaint # doesn't work
|
#bind -s --preset -m insert O beginning-of-line "commandline -i \n" up-line force-repaint # doesn't work
|
||||||
|
|
||||||
bind --preset gg beginning-of-buffer
|
bind -s --preset gg beginning-of-buffer
|
||||||
bind --preset G end-of-buffer
|
bind -s --preset G end-of-buffer
|
||||||
|
|
||||||
for key in $eol_keys
|
for key in $eol_keys
|
||||||
bind --preset $key end-of-line
|
bind -s --preset $key end-of-line
|
||||||
end
|
end
|
||||||
for key in $bol_keys
|
for key in $bol_keys
|
||||||
bind --preset $key beginning-of-line
|
bind -s --preset $key beginning-of-line
|
||||||
end
|
end
|
||||||
|
|
||||||
bind --preset u history-search-backward
|
bind -s --preset u history-search-backward
|
||||||
bind --preset \cr history-search-forward
|
bind -s --preset \cr history-search-forward
|
||||||
|
|
||||||
bind --preset [ history-token-search-backward
|
bind -s --preset [ history-token-search-backward
|
||||||
bind --preset ] history-token-search-forward
|
bind -s --preset ] history-token-search-forward
|
||||||
|
|
||||||
bind --preset k up-or-search
|
bind -s --preset k up-or-search
|
||||||
bind --preset j down-or-search
|
bind -s --preset j down-or-search
|
||||||
bind --preset b backward-word
|
bind -s --preset b backward-word
|
||||||
bind --preset B backward-bigword
|
bind -s --preset B backward-bigword
|
||||||
bind --preset ge backward-word
|
bind -s --preset ge backward-word
|
||||||
bind --preset gE backward-bigword
|
bind -s --preset gE backward-bigword
|
||||||
bind --preset w forward-word forward-char
|
bind -s --preset w forward-word forward-char
|
||||||
bind --preset W forward-bigword forward-char
|
bind -s --preset W forward-bigword forward-char
|
||||||
bind --preset e forward-char forward-word backward-char
|
bind -s --preset e forward-char forward-word backward-char
|
||||||
bind --preset E forward-bigword backward-char
|
bind -s --preset E forward-bigword backward-char
|
||||||
|
|
||||||
# OS X SnowLeopard doesn't have these keys. Don't show an annoying error message.
|
# OS X SnowLeopard doesn't have these keys. Don't show an annoying error message.
|
||||||
# Vi/Vim doesn't support these keys in insert mode but that seems silly so we do so anyway.
|
# Vi/Vim doesn't support these keys in insert mode but that seems silly so we do so anyway.
|
||||||
bind --preset $argv insert -k home beginning-of-line 2>/dev/null
|
bind -s --preset -M insert -k home beginning-of-line 2>/dev/null
|
||||||
bind --preset $argv default -k home beginning-of-line 2>/dev/null
|
bind -s --preset -M default -k home beginning-of-line 2>/dev/null
|
||||||
bind --preset $argv insert -k end end-of-line 2>/dev/null
|
bind -s --preset -M insert -k end end-of-line 2>/dev/null
|
||||||
bind --preset $argv default -k end end-of-line 2>/dev/null
|
bind -s --preset -M default -k end end-of-line 2>/dev/null
|
||||||
|
|
||||||
# Vi moves the cursor back if, after deleting, it is at EOL.
|
# Vi moves the cursor back if, after deleting, it is at EOL.
|
||||||
# To emulate that, move forward, then backward, which will be a NOP
|
# To emulate that, move forward, then backward, which will be a NOP
|
||||||
# if there is something to move forward to.
|
# if there is something to move forward to.
|
||||||
bind --preset $argv default x delete-char forward-char backward-char
|
bind -s --preset -M default x delete-char forward-char backward-char
|
||||||
bind --preset $argv default X backward-delete-char
|
bind -s --preset -M default X backward-delete-char
|
||||||
bind --preset $argv insert -k dc delete-char forward-char backward-char
|
bind -s --preset -M insert -k dc delete-char forward-char backward-char
|
||||||
bind --preset $argv default -k dc delete-char forward-char backward-char
|
bind -s --preset -M default -k dc delete-char forward-char backward-char
|
||||||
|
|
||||||
# Backspace deletes a char in insert mode, but not in normal/default mode.
|
# Backspace deletes a char in insert mode, but not in normal/default mode.
|
||||||
bind --preset $argv insert -k backspace backward-delete-char
|
bind -s --preset -M insert -k backspace backward-delete-char
|
||||||
bind --preset $argv default -k backspace backward-char
|
bind -s --preset -M default -k backspace backward-char
|
||||||
bind --preset $argv insert \ch backward-delete-char
|
bind -s --preset -M insert \ch backward-delete-char
|
||||||
bind --preset $argv default \ch backward-char
|
bind -s --preset -M default \ch backward-char
|
||||||
bind --preset $argv insert \x7f backward-delete-char
|
bind -s --preset -M insert \x7f backward-delete-char
|
||||||
bind --preset $argv default \x7f backward-char
|
bind -s --preset -M default \x7f backward-char
|
||||||
bind --preset $argv insert \e\[3\;2~ backward-delete-char # Mavericks Terminal.app shift-ctrl-delete
|
bind -s --preset -M insert \e\[3\;2~ backward-delete-char # Mavericks Terminal.app shift-ctrl-delete
|
||||||
bind --preset $argv default \e\[3\;2~ backward-delete-char # Mavericks Terminal.app shift-ctrl-delete
|
bind -s --preset -M default \e\[3\;2~ backward-delete-char # Mavericks Terminal.app shift-ctrl-delete
|
||||||
|
|
||||||
bind --preset dd kill-whole-line
|
bind -s --preset dd kill-whole-line
|
||||||
bind --preset D kill-line
|
bind -s --preset D kill-line
|
||||||
bind --preset d\$ kill-line
|
bind -s --preset d\$ kill-line
|
||||||
bind --preset d\^ backward-kill-line
|
bind -s --preset d\^ backward-kill-line
|
||||||
bind --preset dw kill-word
|
bind -s --preset dw kill-word
|
||||||
bind --preset dW kill-bigword
|
bind -s --preset dW kill-bigword
|
||||||
bind --preset diw forward-char forward-char backward-word kill-word
|
bind -s --preset diw forward-char forward-char backward-word kill-word
|
||||||
bind --preset diW forward-char forward-char backward-bigword kill-bigword
|
bind -s --preset diW forward-char forward-char backward-bigword kill-bigword
|
||||||
bind --preset daw forward-char forward-char backward-word kill-word
|
bind -s --preset daw forward-char forward-char backward-word kill-word
|
||||||
bind --preset daW forward-char forward-char backward-bigword kill-bigword
|
bind -s --preset daW forward-char forward-char backward-bigword kill-bigword
|
||||||
bind --preset de kill-word
|
bind -s --preset de kill-word
|
||||||
bind --preset dE kill-bigword
|
bind -s --preset dE kill-bigword
|
||||||
bind --preset db backward-kill-word
|
bind -s --preset db backward-kill-word
|
||||||
bind --preset dB backward-kill-bigword
|
bind -s --preset dB backward-kill-bigword
|
||||||
bind --preset dge backward-kill-word
|
bind -s --preset dge backward-kill-word
|
||||||
bind --preset dgE backward-kill-bigword
|
bind -s --preset dgE backward-kill-bigword
|
||||||
bind --preset df begin-selection forward-jump kill-selection end-selection
|
bind -s --preset df begin-selection forward-jump kill-selection end-selection
|
||||||
bind --preset dt begin-selection forward-jump backward-char kill-selection end-selection
|
bind -s --preset dt begin-selection forward-jump backward-char kill-selection end-selection
|
||||||
bind --preset dF begin-selection backward-jump kill-selection end-selection
|
bind -s --preset dF begin-selection backward-jump kill-selection end-selection
|
||||||
bind --preset dT begin-selection backward-jump forward-char kill-selection end-selection
|
bind -s --preset dT begin-selection backward-jump forward-char kill-selection end-selection
|
||||||
|
|
||||||
bind --preset -m insert s delete-char force-repaint
|
bind -s --preset -m insert s delete-char force-repaint
|
||||||
bind --preset -m insert S kill-whole-line force-repaint
|
bind -s --preset -m insert S kill-whole-line force-repaint
|
||||||
bind --preset -m insert cc kill-whole-line force-repaint
|
bind -s --preset -m insert cc kill-whole-line force-repaint
|
||||||
bind --preset -m insert C kill-line force-repaint
|
bind -s --preset -m insert C kill-line force-repaint
|
||||||
bind --preset -m insert c\$ kill-line force-repaint
|
bind -s --preset -m insert c\$ kill-line force-repaint
|
||||||
bind --preset -m insert c\^ backward-kill-line force-repaint
|
bind -s --preset -m insert c\^ backward-kill-line force-repaint
|
||||||
bind --preset -m insert cw kill-word force-repaint
|
bind -s --preset -m insert cw kill-word force-repaint
|
||||||
bind --preset -m insert cW kill-bigword force-repaint
|
bind -s --preset -m insert cW kill-bigword force-repaint
|
||||||
bind --preset -m insert ciw forward-char forward-char backward-word kill-word force-repaint
|
bind -s --preset -m insert ciw forward-char forward-char backward-word kill-word force-repaint
|
||||||
bind --preset -m insert ciW forward-char forward-char backward-bigword kill-bigword force-repaint
|
bind -s --preset -m insert ciW forward-char forward-char backward-bigword kill-bigword force-repaint
|
||||||
bind --preset -m insert caw forward-char forward-char backward-word kill-word force-repaint
|
bind -s --preset -m insert caw forward-char forward-char backward-word kill-word force-repaint
|
||||||
bind --preset -m insert caW forward-char forward-char backward-bigword kill-bigword force-repaint
|
bind -s --preset -m insert caW forward-char forward-char backward-bigword kill-bigword force-repaint
|
||||||
bind --preset -m insert ce kill-word force-repaint
|
bind -s --preset -m insert ce kill-word force-repaint
|
||||||
bind --preset -m insert cE kill-bigword force-repaint
|
bind -s --preset -m insert cE kill-bigword force-repaint
|
||||||
bind --preset -m insert cb backward-kill-word force-repaint
|
bind -s --preset -m insert cb backward-kill-word force-repaint
|
||||||
bind --preset -m insert cB backward-kill-bigword force-repaint
|
bind -s --preset -m insert cB backward-kill-bigword force-repaint
|
||||||
bind --preset -m insert cge backward-kill-word force-repaint
|
bind -s --preset -m insert cge backward-kill-word force-repaint
|
||||||
bind --preset -m insert cgE backward-kill-bigword force-repaint
|
bind -s --preset -m insert cgE backward-kill-bigword force-repaint
|
||||||
|
|
||||||
bind --preset '~' capitalize-word
|
bind -s --preset '~' capitalize-word
|
||||||
bind --preset gu downcase-word
|
bind -s --preset gu downcase-word
|
||||||
bind --preset gU upcase-word
|
bind -s --preset gU upcase-word
|
||||||
|
|
||||||
bind --preset J end-of-line delete-char
|
bind -s --preset J end-of-line delete-char
|
||||||
bind --preset K 'man (commandline -t) 2>/dev/null; or echo -n \a'
|
bind -s --preset K 'man (commandline -t) 2>/dev/null; or echo -n \a'
|
||||||
|
|
||||||
bind --preset yy kill-whole-line yank
|
bind -s --preset yy kill-whole-line yank
|
||||||
bind --preset Y kill-whole-line yank
|
bind -s --preset Y kill-whole-line yank
|
||||||
bind --preset y\$ kill-line yank
|
bind -s --preset y\$ kill-line yank
|
||||||
bind --preset y\^ backward-kill-line yank
|
bind -s --preset y\^ backward-kill-line yank
|
||||||
bind --preset yw kill-word yank
|
bind -s --preset yw kill-word yank
|
||||||
bind --preset yW kill-bigword yank
|
bind -s --preset yW kill-bigword yank
|
||||||
bind --preset yiw forward-char forward-char backward-word kill-word yank
|
bind -s --preset yiw forward-char forward-char backward-word kill-word yank
|
||||||
bind --preset yiW forward-char forward-char backward-bigword kill-bigword yank
|
bind -s --preset yiW forward-char forward-char backward-bigword kill-bigword yank
|
||||||
bind --preset yaw forward-char forward-char backward-word kill-word yank
|
bind -s --preset yaw forward-char forward-char backward-word kill-word yank
|
||||||
bind --preset yaW forward-char forward-char backward-bigword kill-bigword yank
|
bind -s --preset yaW forward-char forward-char backward-bigword kill-bigword yank
|
||||||
bind --preset ye kill-word yank
|
bind -s --preset ye kill-word yank
|
||||||
bind --preset yE kill-bigword yank
|
bind -s --preset yE kill-bigword yank
|
||||||
bind --preset yb backward-kill-word yank
|
bind -s --preset yb backward-kill-word yank
|
||||||
bind --preset yB backward-kill-bigword yank
|
bind -s --preset yB backward-kill-bigword yank
|
||||||
bind --preset yge backward-kill-word yank
|
bind -s --preset yge backward-kill-word yank
|
||||||
bind --preset ygE backward-kill-bigword yank
|
bind -s --preset ygE backward-kill-bigword yank
|
||||||
|
|
||||||
bind --preset f forward-jump
|
bind -s --preset f forward-jump
|
||||||
bind --preset F backward-jump
|
bind -s --preset F backward-jump
|
||||||
bind --preset t forward-jump-till
|
bind -s --preset t forward-jump-till
|
||||||
bind --preset T backward-jump-till
|
bind -s --preset T backward-jump-till
|
||||||
bind --preset ';' repeat-jump
|
bind -s --preset ';' repeat-jump
|
||||||
bind --preset , repeat-jump-reverse
|
bind -s --preset , repeat-jump-reverse
|
||||||
|
|
||||||
# in emacs yank means paste
|
# in emacs yank means paste
|
||||||
bind --preset p yank
|
bind -s --preset p yank
|
||||||
bind --preset P backward-char yank
|
bind -s --preset P backward-char yank
|
||||||
bind --preset gp yank-pop
|
bind -s --preset gp yank-pop
|
||||||
|
|
||||||
bind --preset '"*p' "commandline -i ( xsel -p; echo )[1]"
|
bind -s --preset '"*p' "commandline -i ( xsel -p; echo )[1]"
|
||||||
bind --preset '"*P' backward-char "commandline -i ( xsel -p; echo )[1]"
|
bind -s --preset '"*P' backward-char "commandline -i ( xsel -p; echo )[1]"
|
||||||
|
|
||||||
#
|
#
|
||||||
# Lowercase r, enters replace_one mode
|
# Lowercase r, enters replace_one mode
|
||||||
#
|
#
|
||||||
bind --preset -m replace_one r force-repaint
|
bind -s --preset -m replace_one r force-repaint
|
||||||
bind --preset $argv replace_one -m default '' delete-char self-insert backward-char force-repaint
|
bind -s --preset -M replace_one -m default '' delete-char self-insert backward-char force-repaint
|
||||||
bind --preset $argv replace_one -m default \e cancel force-repaint
|
bind -s --preset -M replace_one -m default \e cancel force-repaint
|
||||||
|
|
||||||
#
|
#
|
||||||
# visual mode
|
# visual mode
|
||||||
#
|
#
|
||||||
bind --preset $argv visual h backward-char
|
bind -s --preset -M visual h backward-char
|
||||||
bind --preset $argv visual l forward-char
|
bind -s --preset -M visual l forward-char
|
||||||
|
|
||||||
bind --preset $argv visual k up-line
|
bind -s --preset -M visual k up-line
|
||||||
bind --preset $argv visual j down-line
|
bind -s --preset -M visual j down-line
|
||||||
|
|
||||||
bind --preset $argv visual b backward-word
|
bind -s --preset -M visual b backward-word
|
||||||
bind --preset $argv visual B backward-bigword
|
bind -s --preset -M visual B backward-bigword
|
||||||
bind --preset $argv visual ge backward-word
|
bind -s --preset -M visual ge backward-word
|
||||||
bind --preset $argv visual gE backward-bigword
|
bind -s --preset -M visual gE backward-bigword
|
||||||
bind --preset $argv visual w forward-word
|
bind -s --preset -M visual w forward-word
|
||||||
bind --preset $argv visual W forward-bigword
|
bind -s --preset -M visual W forward-bigword
|
||||||
bind --preset $argv visual e forward-word
|
bind -s --preset -M visual e forward-word
|
||||||
bind --preset $argv visual E forward-bigword
|
bind -s --preset -M visual E forward-bigword
|
||||||
bind --preset $argv visual o swap-selection-start-stop force-repaint
|
bind -s --preset -M visual o swap-selection-start-stop force-repaint
|
||||||
|
|
||||||
bind --preset $argv visual f forward-jump
|
bind -s --preset -M visual f forward-jump
|
||||||
bind --preset $argv visual t forward-jump-till
|
bind -s --preset -M visual t forward-jump-till
|
||||||
bind --preset $argv visual F backward-jump
|
bind -s --preset -M visual F backward-jump
|
||||||
bind --preset $argv visual T backward-jump-till
|
bind -s --preset -M visual T backward-jump-till
|
||||||
|
|
||||||
for key in $eol_keys
|
for key in $eol_keys
|
||||||
bind --preset $argv visual $key end-of-line
|
bind -s --preset -M visual $key end-of-line
|
||||||
end
|
end
|
||||||
for key in $bol_keys
|
for key in $bol_keys
|
||||||
bind --preset $argv visual $key beginning-of-line
|
bind -s --preset -M visual $key beginning-of-line
|
||||||
end
|
end
|
||||||
|
|
||||||
bind --preset $argv visual -m insert c kill-selection end-selection force-repaint
|
bind -s --preset -M visual -m insert c kill-selection end-selection force-repaint
|
||||||
bind --preset $argv visual -m default d kill-selection end-selection force-repaint
|
bind -s --preset -M visual -m default d kill-selection end-selection force-repaint
|
||||||
bind --preset $argv visual -m default x kill-selection end-selection force-repaint
|
bind -s --preset -M visual -m default x kill-selection end-selection force-repaint
|
||||||
bind --preset $argv visual -m default X kill-whole-line end-selection force-repaint
|
bind -s --preset -M visual -m default X kill-whole-line end-selection force-repaint
|
||||||
bind --preset $argv visual -m default y kill-selection yank end-selection force-repaint
|
bind -s --preset -M visual -m default y kill-selection yank end-selection force-repaint
|
||||||
bind --preset $argv visual -m default '"*y' "commandline -s | xsel -p; commandline -f end-selection force-repaint"
|
bind -s --preset -M visual -m default '"*y' "commandline -s | xsel -p; commandline -f end-selection force-repaint"
|
||||||
|
|
||||||
bind --preset $argv visual -m default \cc end-selection force-repaint
|
bind -s --preset -M visual -m default \cc end-selection force-repaint
|
||||||
bind --preset $argv visual -m default \e end-selection force-repaint
|
bind -s --preset -M visual -m default \e end-selection force-repaint
|
||||||
|
|
||||||
# Make it easy to turn an unexecuted command into a comment in the shell history. Also, remove
|
# Make it easy to turn an unexecuted command into a comment in the shell history. Also, remove
|
||||||
# the commenting chars so the command can be further edited then executed.
|
# the commenting chars so the command can be further edited then executed.
|
||||||
bind --preset $argv default \# __fish_toggle_comment_commandline
|
bind -s --preset -M default \# __fish_toggle_comment_commandline
|
||||||
bind --preset $argv visual \# __fish_toggle_comment_commandline
|
bind -s --preset -M visual \# __fish_toggle_comment_commandline
|
||||||
|
|
||||||
# Set the cursor shape
|
# Set the cursor shape
|
||||||
# After executing once, this will have defined functions listening for the variable.
|
# After executing once, this will have defined functions listening for the variable.
|
||||||
|
|||||||
@@ -32,7 +32,6 @@ function history --description "display or manipulate interactive command histor
|
|||||||
|
|
||||||
set -l hist_cmd
|
set -l hist_cmd
|
||||||
set -l show_time
|
set -l show_time
|
||||||
set -l skip_indent
|
|
||||||
set -l max_count
|
set -l max_count
|
||||||
set -q _flag_max
|
set -q _flag_max
|
||||||
set max_count -n$_flag_max
|
set max_count -n$_flag_max
|
||||||
@@ -41,10 +40,6 @@ function history --description "display or manipulate interactive command histor
|
|||||||
and set -l _flag_show_time $_flag_with_time
|
and set -l _flag_show_time $_flag_with_time
|
||||||
if set -q _flag_show_time[1]
|
if set -q _flag_show_time[1]
|
||||||
set show_time --show-time=$_flag_show_time
|
set show_time --show-time=$_flag_show_time
|
||||||
# `history -t` by default shows timestamps on seperate lines beginning with # characters.
|
|
||||||
# When colorized the timetamps would highlighted as comments by fish_indent. With a custom
|
|
||||||
# format there is no guarantee fish_indent can do anything useful.
|
|
||||||
set skip_indent true
|
|
||||||
else if set -q _flag_show_time
|
else if set -q _flag_show_time
|
||||||
set show_time --show-time
|
set show_time --show-time
|
||||||
end
|
end
|
||||||
@@ -93,18 +88,15 @@ function history --description "display or manipulate interactive command histor
|
|||||||
and set pager $PAGER
|
and set pager $PAGER
|
||||||
|
|
||||||
# If the user hasn't preconfigured less with the $LESS environment variable,
|
# If the user hasn't preconfigured less with the $LESS environment variable,
|
||||||
# we do so to prevent the stripping of control characters (for color) and have
|
# we do so to have it behave like cat if output fits on one screen. Prevent the
|
||||||
# it behave like cat if output fits on one screen. Prevent the screen from clearing
|
# screen from clearing on quit, so there is something to see if it exits.
|
||||||
# on quit, so there is something to see if it exits.
|
# These are two of the options `git` sets through $LESS before starting the pager.
|
||||||
# These are the same three options `git` sets through $LESS before starting the pager.
|
|
||||||
not set -qx LESS
|
not set -qx LESS
|
||||||
and set -x LESS --RAW-CONTROL-CHARS --quit-if-one-screen --no-init
|
and set -x LESS --quit-if-one-screen --no-init
|
||||||
not set -qx LV # ask the pager lv not to strip colors
|
not set -qx LV # ask the pager lv not to strip colors
|
||||||
and set -x LV -c
|
and set -x LV -c
|
||||||
|
|
||||||
set -q skip_indent[1] # --show-time=FORMAT set, arbitrary output may not be valid fish script
|
builtin history search $search_mode $show_time $max_count $_flag_case_sensitive $_flag_reverse $_flag_null -- $argv | $pager
|
||||||
and builtin history search $search_mode $show_time $max_count $_flag_case_sensitive $_flag_reverse $_flag_null -- $argv | $pager
|
|
||||||
or builtin history search $search_mode $show_time $max_count $_flag_case_sensitive $_flag_reverse $_flag_null -- $argv | fish_indent --ansi | $pager
|
|
||||||
else
|
else
|
||||||
builtin history search $search_mode $show_time $max_count $_flag_case_sensitive $_flag_reverse $_flag_null -- $argv
|
builtin history search $search_mode $show_time $max_count $_flag_case_sensitive $_flag_reverse $_flag_null -- $argv
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -648,7 +648,6 @@ static bool parse_number(const wcstring &arg, number_t *number, wcstring_list_t
|
|||||||
const wchar_t *argcs = arg.c_str();
|
const wchar_t *argcs = arg.c_str();
|
||||||
double floating = 0;
|
double floating = 0;
|
||||||
bool got_float = parse_double(argcs, &floating);
|
bool got_float = parse_double(argcs, &floating);
|
||||||
|
|
||||||
errno = 0;
|
errno = 0;
|
||||||
long long integral = fish_wcstoll(argcs);
|
long long integral = fish_wcstoll(argcs);
|
||||||
bool got_int = (errno == 0);
|
bool got_int = (errno == 0);
|
||||||
@@ -656,18 +655,26 @@ static bool parse_number(const wcstring &arg, number_t *number, wcstring_list_t
|
|||||||
// Here the value is just an integer; ignore the floating point parse because it may be
|
// Here the value is just an integer; ignore the floating point parse because it may be
|
||||||
// invalid (e.g. not a representable integer).
|
// invalid (e.g. not a representable integer).
|
||||||
*number = number_t{integral, 0.0};
|
*number = number_t{integral, 0.0};
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
} else if (got_float) {
|
} else if (got_float && errno != ERANGE) {
|
||||||
// Here we parsed an (in range) floating point value that could not be parsed as an integer.
|
// Here we parsed an (in range) floating point value that could not be parsed as an integer.
|
||||||
// Break the floating point value into base and delta. Ensure that base is <= the floating
|
// Break the floating point value into base and delta. Ensure that base is <= the floating
|
||||||
// point value.
|
// point value.
|
||||||
double intpart = std::floor(floating);
|
double intpart = std::floor(floating);
|
||||||
double delta = floating - intpart;
|
double delta = floating - intpart;
|
||||||
*number = number_t{static_cast<long long>(intpart), delta};
|
*number = number_t{static_cast<long long>(intpart), delta};
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
} else {
|
} else {
|
||||||
// We could not parse a float or an int.
|
// We could not parse a float or an int.
|
||||||
errors.push_back(format_string(_(L"invalid number '%ls'"), arg.c_str()));
|
// Check for special fish_wcsto* value or show standard EINVAL/ERANGE error.
|
||||||
|
if (errno == -1) {
|
||||||
|
errors.push_back(format_string(_(L"Integer %lld in '%ls' followed by non-digit"),
|
||||||
|
integral, argcs));
|
||||||
|
} else {
|
||||||
|
errors.push_back(format_string(L"%s: '%ls'", strerror(errno), argcs));
|
||||||
|
}
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -829,7 +836,7 @@ int builtin_test(parser_t &parser, io_streams_t &streams, wchar_t **argv) {
|
|||||||
const wcstring_list_t args(argv + 1, argv + 1 + argc);
|
const wcstring_list_t args(argv + 1, argv + 1 + argc);
|
||||||
|
|
||||||
if (argc == 0) {
|
if (argc == 0) {
|
||||||
return STATUS_CMD_ERROR; // Per 1003.1, exit false.
|
return STATUS_INVALID_ARGS; // Per 1003.1, exit false.
|
||||||
} else if (argc == 1) {
|
} else if (argc == 1) {
|
||||||
// Per 1003.1, exit true if the arg is non-empty.
|
// Per 1003.1, exit true if the arg is non-empty.
|
||||||
return args.at(0).empty() ? STATUS_CMD_ERROR : STATUS_CMD_OK;
|
return args.at(0).empty() ? STATUS_CMD_ERROR : STATUS_CMD_OK;
|
||||||
@@ -852,11 +859,13 @@ int builtin_test(parser_t &parser, io_streams_t &streams, wchar_t **argv) {
|
|||||||
|
|
||||||
wcstring_list_t eval_errors;
|
wcstring_list_t eval_errors;
|
||||||
bool result = expr->evaluate(eval_errors);
|
bool result = expr->evaluate(eval_errors);
|
||||||
if (!eval_errors.empty() && !should_suppress_stderr_for_tests()) {
|
if (!eval_errors.empty()) {
|
||||||
streams.err.append(L"test returned eval errors:\n");
|
if (!should_suppress_stderr_for_tests()) {
|
||||||
for (size_t i = 0; i < eval_errors.size(); i++) {
|
for (size_t i = 0; i < eval_errors.size(); i++) {
|
||||||
streams.err.append_format(L"\t%ls\n", eval_errors.at(i).c_str());
|
streams.err.append_format(L"\t%ls\n", eval_errors.at(i).c_str());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
return STATUS_INVALID_ARGS;
|
||||||
}
|
}
|
||||||
return result ? STATUS_CMD_OK : STATUS_CMD_ERROR;
|
return result ? STATUS_CMD_OK : STATUS_CMD_ERROR;
|
||||||
}
|
}
|
||||||
|
|||||||
10
src/common.h
10
src/common.h
@@ -1078,9 +1078,13 @@ enum {
|
|||||||
STATUS_CMD_OK = 0,
|
STATUS_CMD_OK = 0,
|
||||||
/// The status code used for failure exit in a command (but not if the args were invalid).
|
/// The status code used for failure exit in a command (but not if the args were invalid).
|
||||||
STATUS_CMD_ERROR = 1,
|
STATUS_CMD_ERROR = 1,
|
||||||
|
/// The status code used for invalid arguments given to a command. This is distinct from valid
|
||||||
|
/// arguments that might result in a command failure. An invalid args condition is something
|
||||||
|
/// like an unrecognized flag, missing or too many arguments, an invalid integer, etc. But
|
||||||
|
STATUS_INVALID_ARGS = 2,
|
||||||
|
|
||||||
/// The status code used when a command was not found.
|
/// The status code used when a command was not found.
|
||||||
STATUS_CMD_UNKNOWN = 127,
|
STATUS_CMD_UNKNOWN = 127,
|
||||||
|
|
||||||
/// TODO: Figure out why we have two distinct failure codes for when an external command cannot
|
/// TODO: Figure out why we have two distinct failure codes for when an external command cannot
|
||||||
/// be run.
|
/// be run.
|
||||||
///
|
///
|
||||||
@@ -1095,10 +1099,6 @@ enum {
|
|||||||
STATUS_ILLEGAL_CMD = 123,
|
STATUS_ILLEGAL_CMD = 123,
|
||||||
/// The status code used when `read` is asked to consume too much data.
|
/// The status code used when `read` is asked to consume too much data.
|
||||||
STATUS_READ_TOO_MUCH = 122,
|
STATUS_READ_TOO_MUCH = 122,
|
||||||
/// The status code used for invalid arguments given to a command. This is distinct from valid
|
|
||||||
/// arguments that might result in a command failure. An invalid args condition is something
|
|
||||||
/// like an unrecognized flag, missing or too many arguments, an invalid integer, etc. But
|
|
||||||
STATUS_INVALID_ARGS = 121,
|
|
||||||
};
|
};
|
||||||
|
|
||||||
/* Normally casting an expression to void discards its value, but GCC
|
/* Normally casting an expression to void discards its value, but GCC
|
||||||
|
|||||||
@@ -388,3 +388,18 @@ int flock(int fd, int op) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
#endif // HAVE_FLOCK
|
#endif // HAVE_FLOCK
|
||||||
|
|
||||||
|
#ifndef HAVE_WCSTOD_L
|
||||||
|
// musl doesn't feature wcstod_l,
|
||||||
|
// so we just wrap wcstod.
|
||||||
|
double wcstod_l(const wchar_t *enptr, wchar_t **endptr, locale_t loc) {
|
||||||
|
char *saved_locale = strdup(setlocale(LC_NUMERIC, NULL));
|
||||||
|
// Yes, this is hardcoded to use the "C" locale.
|
||||||
|
// That's the only thing we need, and uselocale(loc) broke in my testing.
|
||||||
|
setlocale(LC_NUMERIC, "C");
|
||||||
|
double ret = wcstod(enptr, endptr);
|
||||||
|
setlocale(LC_NUMERIC, saved_locale);
|
||||||
|
free(saved_locale);
|
||||||
|
return ret;
|
||||||
|
}
|
||||||
|
#endif // defined(wcstod_l)
|
||||||
|
|||||||
@@ -198,3 +198,7 @@ int flock(int fd, int op);
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#ifndef HAVE_WCSTOD_L
|
||||||
|
double wcstod_l(const wchar_t *enptr, wchar_t **endptr, locale_t loc);
|
||||||
|
#endif
|
||||||
|
|||||||
@@ -2155,7 +2155,12 @@ static bool run_one_test_test(int expected, wcstring_list_t &lst, bool bracket)
|
|||||||
argv[i + 1] = NULL;
|
argv[i + 1] = NULL;
|
||||||
io_streams_t streams(0);
|
io_streams_t streams(0);
|
||||||
int result = builtin_test(parser, streams, argv);
|
int result = builtin_test(parser, streams, argv);
|
||||||
|
|
||||||
|
if (expected != result)
|
||||||
|
err(L"expected builtin_test() to return %d, got %d", expected, result);
|
||||||
|
|
||||||
delete[] argv;
|
delete[] argv;
|
||||||
|
|
||||||
return expected == result;
|
return expected == result;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -2207,13 +2212,13 @@ static void test_test() {
|
|||||||
do_test(run_test_test(0, L"' 2' -eq 2"));
|
do_test(run_test_test(0, L"' 2' -eq 2"));
|
||||||
do_test(run_test_test(0, L"'2 ' -eq 2"));
|
do_test(run_test_test(0, L"'2 ' -eq 2"));
|
||||||
do_test(run_test_test(0, L"' 2 ' -eq 2"));
|
do_test(run_test_test(0, L"' 2 ' -eq 2"));
|
||||||
do_test(run_test_test(1, L"' 2x' -eq 2"));
|
do_test(run_test_test(2, L"' 2x' -eq 2"));
|
||||||
do_test(run_test_test(1, L"'' -eq 0"));
|
do_test(run_test_test(2, L"'' -eq 0"));
|
||||||
do_test(run_test_test(1, L"'' -ne 0"));
|
do_test(run_test_test(2, L"'' -ne 0"));
|
||||||
do_test(run_test_test(1, L"' ' -eq 0"));
|
do_test(run_test_test(2, L"' ' -eq 0"));
|
||||||
do_test(run_test_test(1, L"' ' -ne 0"));
|
do_test(run_test_test(2, L"' ' -ne 0"));
|
||||||
do_test(run_test_test(1, L"'x' -eq 0"));
|
do_test(run_test_test(2, L"'x' -eq 0"));
|
||||||
do_test(run_test_test(1, L"'x' -ne 0"));
|
do_test(run_test_test(2, L"'x' -ne 0"));
|
||||||
do_test(run_test_test(1, L"-1 -ne -1"));
|
do_test(run_test_test(1, L"-1 -ne -1"));
|
||||||
do_test(run_test_test(0, L"abc != def"));
|
do_test(run_test_test(0, L"abc != def"));
|
||||||
do_test(run_test_test(1, L"abc = def"));
|
do_test(run_test_test(1, L"abc = def"));
|
||||||
@@ -2284,6 +2289,10 @@ static void test_test() {
|
|||||||
do_test(run_test_test(1, L"-4611686018427387904 -ge 4611686018427387904"));
|
do_test(run_test_test(1, L"-4611686018427387904 -ge 4611686018427387904"));
|
||||||
do_test(run_test_test(1, L"4611686018427387904 -gt 4611686018427387904"));
|
do_test(run_test_test(1, L"4611686018427387904 -gt 4611686018427387904"));
|
||||||
do_test(run_test_test(0, L"4611686018427387904 -ge 4611686018427387904"));
|
do_test(run_test_test(0, L"4611686018427387904 -ge 4611686018427387904"));
|
||||||
|
|
||||||
|
// test out-of-range numbers
|
||||||
|
do_test(run_test_test(2, L"99999999999999999999999999 -ge 1"));
|
||||||
|
do_test(run_test_test(2, L"1 -eq -99999999999999999999999999.9"));
|
||||||
}
|
}
|
||||||
|
|
||||||
static void test_wcstod() {
|
static void test_wcstod() {
|
||||||
|
|||||||
@@ -38,7 +38,7 @@ Test 22 pass
|
|||||||
6 0
|
6 0
|
||||||
7 4
|
7 4
|
||||||
8 0
|
8 0
|
||||||
9 121
|
9 2
|
||||||
10 0 A
|
10 0 A
|
||||||
11 1 B
|
11 1 B
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user