Compare commits

..

19 Commits

Author SHA1 Message Date
David Adam
54360d8cfe Bump version for 2.4.0 2016-11-08 11:20:54 +08:00
David Adam
0b0d0e7799 CHANGELOG: updates for 2.4.0 2016-11-08 11:20:50 +08:00
Fabian Homborg
c9c311fbdb fish_vi_cursor: Ignore errors from tput
Fixes #3519.

(cherry picked from commit b9b66791c1)
2016-11-03 15:41:16 +08:00
Aaron Gyes
e4ce5ca24f Revert "sorin right prompt: reset color at end"
This reverts commit 9701d5cc7b.
2016-10-31 23:43:46 -07:00
Aaron Gyes
01fb830bf5 Revert "Sorin prompt: updates"
This reverts commit c18614552d.
2016-10-31 23:43:20 -07:00
Aaron Gyes
c18614552d Sorin prompt: updates
Use $USER, prompt_hostname, string
Update to use correct color names such as magenta over purple.
Use bright color variants instead of bold in some cases.
2016-10-31 23:29:50 -07:00
Aaron Gyes
9701d5cc7b sorin right prompt: reset color at end
bold mode being left enabled was causing issues in the pager.
2016-10-31 21:28:05 -07:00
Aaron Gyes
a5f6382d77 Update changelog 2016-10-31 12:03:09 -07:00
Aaron Gyes
b2f047421d Supress fish_title only for Terminal.app
VTE terminals apparently do not use the OSC sequence to compose
title components.
2016-10-31 12:00:44 -07:00
Aaron Gyes
dfe7813c02 Fix Terminal.app title
Defining fish_title here is too late because there will already be a
title set. Work around issue by clearing it at same time.
2016-10-31 12:00:44 -07:00
David Adam
ddbf63c46f CHANGELOG: updates for 2.4.0 2016-10-31 22:35:36 +08:00
Fabian Homborg
c8fe0e53dd Rework cursor detection
Fixes #3499.

(cherry picked from commit 2a5ad198bf)
2016-10-31 21:52:50 +08:00
Fabian Homborg
7bcae09674 Disable vi-cursor on xterm < 282
Fixes #3499.

@zanchey: This is for integration-2.4.0.

(cherry picked from commit 7ea2dc4488)
2016-10-31 21:52:50 +08:00
David Adam
9f23f619c9 Makefile: pass correct version macro
Fixes display of version in documentation header. A shell-style variable
instead of a Makefile-style variable left it displayed as
ISH_BUILD_VERSION.

(cherry picked from commit 1e234f492c)
2016-10-30 14:27:11 +08:00
Kurtis Rader
070ef6fd5b fix regression introduced by commit 851e449
My earlier attempt with commit 851e449 to eliminate all the compiler
warnings about mixing signed and unsigned ints in an expression
introduced a subtle bug. This fixes that mistake.

Fixes #3488

(cherry picked from commit 075be74cc4)
2016-10-26 18:28:49 +08:00
Aaron Gyes
5a8be61954 defaults completions: shorten and improve brevity
At 80 columns the description obscured 'find' in 'default find'.

Improve others.

(cherry picked from commit cbe2d4b5f1)
2016-10-25 08:55:03 +08:00
Fabian Weisshaar
7fdbbe0711 add defaults (macOS) completion
(cherry picked from commit 7878dbc4f0)
2016-10-25 08:55:02 +08:00
Fabian Weisshaar
8af6bb4436 add listFilesystems to diskutil completion
(cherry picked from commit e16f6ca2aa)
2016-10-25 08:55:02 +08:00
Kurtis Rader
31432c3535 Revert "Fix lexicon_filter verbosity"
This reverts commit dcb39af8c0.

It breaks building the documentation because splitting the sed invocation
in the `lexicon_filter` target from the preceding `if` block means the
`WORDBL` and `WORDBR` shell vars aren't available.

(cherry picked from commit 100a0ea549)
2016-10-23 20:54:29 +08:00
10 changed files with 108 additions and 24 deletions

View File

@@ -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

View File

@@ -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 $@;
#

View File

@@ -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>

View File

@@ -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

View 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'

View File

@@ -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)'

View File

@@ -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

View File

@@ -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

View File

@@ -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);

View File

@@ -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: