mirror of
https://github.com/fish-shell/fish-shell.git
synced 2026-05-10 01:21:16 -03:00
Compare commits
19 Commits
2.4b1
...
Integratio
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
54360d8cfe | ||
|
|
0b0d0e7799 | ||
|
|
c9c311fbdb | ||
|
|
e4ce5ca24f | ||
|
|
01fb830bf5 | ||
|
|
c18614552d | ||
|
|
9701d5cc7b | ||
|
|
a5f6382d77 | ||
|
|
b2f047421d | ||
|
|
dfe7813c02 | ||
|
|
ddbf63c46f | ||
|
|
c8fe0e53dd | ||
|
|
7bcae09674 | ||
|
|
9f23f619c9 | ||
|
|
070ef6fd5b | ||
|
|
5a8be61954 | ||
|
|
7fdbbe0711 | ||
|
|
8af6bb4436 | ||
|
|
31432c3535 |
10
CHANGELOG.md
10
CHANGELOG.md
@@ -1,3 +1,13 @@
|
||||
# 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
|
||||
|
||||
@@ -386,7 +386,7 @@ toc.txt: $(HDR_FILES:index.hdr=index.hdr.in) | show-SED
|
||||
@echo " SED $(em)$@$(sgr0)"
|
||||
$v rm -f toc.tmp $@
|
||||
# Ugly hack to set the toc initial title for the main page
|
||||
$v echo '- <a href="index.html" id="toc-index">fish shell documentation - $FISH_BUILD_VERSION</a>' > toc.tmp
|
||||
$v echo '- <a href="index.html" id="toc-index">fish shell documentation - $(FISH_BUILD_VERSION)</a>' > toc.tmp
|
||||
# The first sed command captures the page name, followed by the description
|
||||
# The second sed command captures the command name \1 and the description \2, but only up to a dash
|
||||
# This is to reduce the size of the TOC in the command listing on the main page
|
||||
@@ -453,9 +453,8 @@ lexicon_filter: lexicon.txt lexicon_filter.in | show-SED
|
||||
WORDBL='[[:<:]]'; WORDBR='[[:>:]]'; \
|
||||
else \
|
||||
WORDBL='\\<'; WORDBR='\\>'; \
|
||||
fi
|
||||
$v $(SED) <lexicon.txt >>$@.tmp -n -e "s|^\([a-z][a-z][a-z][a-z]\) \([a-z_-]*\)$$|s,$$WORDBL\2$$WORDBR,@\1{\2},g|p" -e '$$G;s/.*\n/b tidy/p'
|
||||
$v mv $@.tmp $@; test -x $@ || chmod a+x $@;
|
||||
fi; $(SED) <lexicon.txt >>$@.tmp -n -e "s|^\([a-z][a-z][a-z][a-z]\) \([a-z_-]*\)$$|s,$$WORDBL\2$$WORDBR,@\1{\2},g|p" -e '$$G;s/.*\n/b tidy/p';
|
||||
mv $@.tmp $@; test -x $@ || chmod a+x $@;
|
||||
|
||||
|
||||
#
|
||||
|
||||
@@ -17,7 +17,7 @@
|
||||
<key>CFBundlePackageType</key>
|
||||
<string>APPL</string>
|
||||
<key>CFBundleShortVersionString</key>
|
||||
<string>2.3.900</string>
|
||||
<string>2.4.0</string>
|
||||
<key>CFBundleVersion</key>
|
||||
<string>0.1</string>
|
||||
<key>LSApplicationCategoryType</key>
|
||||
|
||||
@@ -167,7 +167,7 @@
|
||||
#define PACKAGE_NAME "fish"
|
||||
|
||||
/* Define to the full name and version of this package. */
|
||||
#define PACKAGE_STRING "fish 2.4b1"
|
||||
#define PACKAGE_STRING "fish 2.4.0"
|
||||
|
||||
/* Define to the one symbol short name of this package. */
|
||||
#define PACKAGE_TARNAME "fish"
|
||||
@@ -176,7 +176,7 @@
|
||||
#define PACKAGE_URL ""
|
||||
|
||||
/* Define to the version of this package. */
|
||||
#define PACKAGE_VERSION "2.4b1"
|
||||
#define PACKAGE_VERSION "2.4.0"
|
||||
|
||||
/* The size of `wchar_t', as computed by sizeof. */
|
||||
#define SIZEOF_WCHAR_T 4
|
||||
|
||||
33
share/completions/defaults.fish
Normal file
33
share/completions/defaults.fish
Normal file
@@ -0,0 +1,33 @@
|
||||
# completion for defaults (macOS)
|
||||
|
||||
function __fish_defaults_domains
|
||||
defaults domains | string split ", "
|
||||
end
|
||||
|
||||
complete -f -c defaults -o 'currentHost' -d 'Restricts preferences operations to the current logged-in host'
|
||||
complete -f -c defaults -o 'host' -d 'Restricts preferences operations to hostname'
|
||||
|
||||
# read
|
||||
complete -f -c defaults -n '__fish_use_subcommand' -a read -d 'Shows defaults entire given domain'
|
||||
complete -f -c defaults -n '__fish_seen_subcommand_from read read-type write rename delete' -a '(__fish_defaults_domains)'
|
||||
complete -f -c defaults -n '__fish_seen_subcommand_from read read-type write rename delete' -o 'app'
|
||||
|
||||
# write
|
||||
complete -f -c defaults -n '__fish_use_subcommand' -a write -d 'Writes domain or or a key in the domain'
|
||||
complete -f -c defaults -n '__fish_seen_subcommand_from write' -o 'string' -d 'String as the value for the given key'
|
||||
complete -f -c defaults -n '__fish_seen_subcommand_from write' -o 'data' -d 'Raw data bytes for given key'
|
||||
complete -f -c defaults -n '__fish_seen_subcommand_from write' -o 'int' -d 'Integer as the value for the given key'
|
||||
complete -f -c defaults -n '__fish_seen_subcommand_from write' -o 'float' -d 'Floating point number as the value for the given key'
|
||||
complete -f -c defaults -n '__fish_seen_subcommand_from write' -o 'bool' -d 'Boolean as the value for the given key'
|
||||
complete -f -c defaults -n '__fish_seen_subcommand_from write' -o 'date' -d 'Date as the value for the given key'
|
||||
complete -f -c defaults -n '__fish_seen_subcommand_from write' -o 'array' -d 'Array as the value for the given key'
|
||||
complete -f -c defaults -n '__fish_seen_subcommand_from write' -o 'array-add' -d 'Add new elements to the end of an array'
|
||||
complete -f -c defaults -n '__fish_seen_subcommand_from write' -o 'dict' -d 'Add a dictionary to domain'
|
||||
complete -f -c defaults -n '__fish_seen_subcommand_from write' -o 'dict-add' -d 'Add new key/value pairs to a dictionary'
|
||||
|
||||
complete -f -c defaults -n '__fish_use_subcommand' -a read-type -d 'Shows the type for the given domain, key'
|
||||
complete -f -c defaults -n '__fish_use_subcommand' -a rename -d 'Renames old_key to new_key'
|
||||
complete -f -c defaults -n '__fish_use_subcommand' -a delete -d 'Deletes domain or a key in the domain'
|
||||
complete -f -c defaults -n '__fish_use_subcommand' -a domains -d 'Prints the names of all domains in the users defaults system'
|
||||
complete -f -c defaults -n '__fish_use_subcommand' -a find -d 'Searches for word in domain names, keys, and values'
|
||||
complete -f -c defaults -n '__fish_use_subcommand' -a help -d 'Prints a list of possible command formats'
|
||||
@@ -1,4 +1,4 @@
|
||||
#completion for diskutil
|
||||
# completion for diskutil (macOS)
|
||||
|
||||
function __fish_diskutil_devices
|
||||
set -l mountpoints /dev/disk*; printf '%s\n' $mountpoints
|
||||
@@ -22,6 +22,10 @@ complete -f -c diskutil -n '__fish_seen_subcommand_from info' -o 'all' -d 'Proce
|
||||
# activity
|
||||
complete -f -c diskutil -n '__fish_use_subcommand' -a activity -d 'Continuously display system-wide disk manipulation activity'
|
||||
|
||||
# listFilesystems
|
||||
complete -f -c diskutil -n '__fish_use_subcommand' -a listFilesystems -d 'Show the file system personalities available'
|
||||
complete -f -c diskutil -n '__fish_seen_subcommand_from listFilesystems' -o 'plist' -d 'Return a property list'
|
||||
|
||||
# umount
|
||||
complete -f -c diskutil -n '__fish_use_subcommand' -a umount -d 'Unmount a single volume'
|
||||
complete -f -c diskutil -n '__fish_seen_subcommand_from umount' -a '(__fish_diskutil_mounted_volumes)'
|
||||
|
||||
@@ -220,13 +220,18 @@ function __fish_config_interactive -d "Initializations that should be performed
|
||||
# Notify terminals when $PWD changes (issue #906)
|
||||
# VTE and Terminal.app support this in practice.
|
||||
if test "0$VTE_VERSION" -ge 3405 -o "$TERM_PROGRAM" = "Apple_Terminal"
|
||||
function fish_title; end
|
||||
function __update_cwd_osc --on-variable PWD --description 'Notify capable terminals when $PWD changes'
|
||||
status --is-command-substitution
|
||||
or test -n "$INSIDE_EMACS"
|
||||
and return
|
||||
printf \e\]7\;file://\%s\%s\a (hostname) (echo -n $PWD | __fish_urlencode)
|
||||
end
|
||||
if test "$TERM_PROGRAM" = "Apple_Terminal"
|
||||
# Suppress duplicative title display on Terminal.app
|
||||
echo -n \e\]0\;\a # clear existing title
|
||||
function fish_title
|
||||
end
|
||||
end
|
||||
__update_cwd_osc # Run once because we might have already inherited a PWD from an old tab
|
||||
end
|
||||
|
||||
|
||||
@@ -1,11 +1,46 @@
|
||||
function fish_vi_cursor -d 'Set cursor shape for different vi modes'
|
||||
# Since we read exported variables (KONSOLE_PROFILE_NAME and ITERM_PROFILE)
|
||||
# we need to check harder if we're actually in a supported terminal,
|
||||
# because we might be in a term-in-a-term (emacs ansi-term).
|
||||
if not contains -- $TERM xterm konsole xterm-256color konsole-256color
|
||||
and not set -q TMUX
|
||||
# Check hard if we are in a supporting terminal.
|
||||
#
|
||||
# Challenges here are term-in-a-terms (emacs ansi-term does not support this, tmux does),
|
||||
# that we can only figure out if we are in konsole/iterm/vte via exported variables,
|
||||
# and ancient xterm versions.
|
||||
#
|
||||
# tmux defaults to $TERM = screen, but can do this if it is in a supporting terminal.
|
||||
# Unfortunately, we can only detect this via the exported variables, so we miss some cases.
|
||||
#
|
||||
# We will also miss some cases of terminal-stacking,
|
||||
# e.g. tmux started in suckless' st (no support) started in konsole.
|
||||
# But since tmux in konsole seems rather common and that case so uncommon,
|
||||
# we will just fail there (though it seems that tmux or st swallow it anyway).
|
||||
#
|
||||
# We use the `tput` here just to see if terminfo thinks we can change the cursor.
|
||||
# We cannot use that sequence directly as it's not the correct one for konsole and iTerm,
|
||||
# and because we may want to change the cursor even though terminfo says we can't (tmux).
|
||||
if not tput Ss > /dev/null ^/dev/null
|
||||
# Whitelist tmux...
|
||||
and not begin
|
||||
set -q TMUX
|
||||
# ...in a supporting term...
|
||||
and begin set -q KONSOLE_PROFILE_NAME
|
||||
or set -q ITERM_PROFILE
|
||||
or test "$VTE_VERSION" -gt 1910
|
||||
end
|
||||
# .. unless an unsupporting terminal has been started in tmux inside a supporting one
|
||||
and begin string match -q "screen*" -- $TERM
|
||||
or string match -q "tmux*" -- $TERM
|
||||
end
|
||||
end
|
||||
and not string match -q "konsole*" -- $TERM
|
||||
# Blacklist
|
||||
or begin
|
||||
# vte-based terms set $TERM = xterm*, but only gained support relatively recently.
|
||||
set -q VTE_VERSION
|
||||
and test "$VTE_VERSION" -le 1910
|
||||
end
|
||||
or set -q INSIDE_EMACS
|
||||
return
|
||||
end
|
||||
|
||||
set -l terminal $argv[1]
|
||||
set -q terminal[1]
|
||||
or set terminal auto
|
||||
@@ -18,11 +53,9 @@ function fish_vi_cursor -d 'Set cursor shape for different vi modes'
|
||||
or set -q ITERM_PROFILE
|
||||
set function __fish_cursor_konsole
|
||||
set uses_echo 1
|
||||
else if string match -q "xterm*" -- $TERM; or test "$VTE_VERSION" -gt 1910
|
||||
else
|
||||
set function __fish_cursor_xterm
|
||||
set uses_echo 1
|
||||
else
|
||||
return 1
|
||||
end
|
||||
case konsole
|
||||
set function __fish_cursor_konsole
|
||||
|
||||
@@ -84,16 +84,15 @@ static int print_max(const wcstring &str, highlight_spec_t color, int max, bool
|
||||
|
||||
/// Print the specified item using at the specified amount of space.
|
||||
line_t pager_t::completion_print_item(const wcstring &prefix, const comp_t *c, size_t row,
|
||||
size_t column, size_t width, bool secondary, bool selected,
|
||||
size_t column, int width, bool secondary, bool selected,
|
||||
page_rendering_t *rendering) const {
|
||||
UNUSED(column);
|
||||
UNUSED(row);
|
||||
UNUSED(rendering);
|
||||
size_t comp_width = 0, desc_width = 0;
|
||||
size_t written = 0;
|
||||
int comp_width, desc_width;
|
||||
line_t line_data;
|
||||
|
||||
if (c->pref_width <= (size_t)width) {
|
||||
if (c->pref_width <= width) {
|
||||
// The entry fits, we give it as much space as it wants.
|
||||
comp_width = c->comp_width;
|
||||
desc_width = c->desc_width;
|
||||
@@ -102,8 +101,8 @@ line_t pager_t::completion_print_item(const wcstring &prefix, const comp_t *c, s
|
||||
// the space to the completion, and whatever is left to the description.
|
||||
int desc_all = c->desc_width ? c->desc_width + 4 : 0;
|
||||
|
||||
comp_width = maxi(mini(c->comp_width, 2 * (width - 4) / 3), width - desc_all);
|
||||
if (c->desc_width) desc_width = width - comp_width - 4;
|
||||
comp_width = maxi(mini((int)c->comp_width, 2 * (width - 4) / 3), width - desc_all);
|
||||
desc_width = c->desc_width ? width - 4 - comp_width : 0;
|
||||
}
|
||||
|
||||
int bg_color = secondary ? highlight_spec_pager_secondary : highlight_spec_normal;
|
||||
@@ -111,6 +110,7 @@ line_t pager_t::completion_print_item(const wcstring &prefix, const comp_t *c, s
|
||||
bg_color = highlight_spec_search_match;
|
||||
}
|
||||
|
||||
int written = 0;
|
||||
for (size_t i = 0; i < c->comp.size(); i++) {
|
||||
const wcstring &comp = c->comp.at(i);
|
||||
|
||||
|
||||
@@ -114,7 +114,7 @@ class pager_t {
|
||||
const wcstring &prefix, const comp_info_list_t &lst,
|
||||
page_rendering_t *rendering) const;
|
||||
line_t completion_print_item(const wcstring &prefix, const comp_t *c, size_t row, size_t column,
|
||||
size_t width, bool secondary, bool selected,
|
||||
int width, bool secondary, bool selected,
|
||||
page_rendering_t *rendering) const;
|
||||
|
||||
public:
|
||||
|
||||
Reference in New Issue
Block a user