Stringify many completions and functions, with --invert stringification.

I believe apm must have been buggy - example output that I found online
showed `tr` was mangling paths with spaces in it. Should be fixed.

Also, use dscl on OS X in __fish_complete_users.fish like
__fish_print_users.fish already does.
This commit is contained in:
Aaron Gyes
2016-04-08 10:46:51 +08:00
committed by David Adam
parent 790c7f80c7
commit 36691df6fe
17 changed files with 35 additions and 31 deletions

View File

@@ -12,7 +12,7 @@ function fish_prompt -d "Write out the prompt"
if [ (_git_branch_name) ]
set -l git_branch (set_color -o blue)(_git_branch_name)
if [ (_is_git_dirty) ]
for i in (git branch -qv --no-color|grep \*|cut -d' ' -f4-|cut -d] -f1|tr , \n)\
for i in (git branch -qv --no-color| string match -r \*|cut -d' ' -f4-|cut -d] -f1|tr , \n)\
(git status --porcelain | cut -c 1-2 | uniq)
switch $i
case "*[ahead *"

View File

@@ -3,7 +3,7 @@
function fish_prompt
and set retc green; or set retc red
tty|grep -q tty; and set tty tty; or set tty pts
tty|string match -q -r tty; and set tty tty; or set tty pts
set_color $retc
if [ $tty = tty ]
@@ -48,7 +48,7 @@ function fish_prompt
echo -n ]
if type -q acpi
if [ (acpi -a 2> /dev/null | grep off) ]
if [ (acpi -a 2> /dev/null | string match -r off) ]
echo -n '─['
set_color -o red
echo -n (acpi -b|cut -d' ' -f 4-)