mirror of
https://github.com/fish-shell/fish-shell.git
synced 2026-06-06 00:41:15 -03:00
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:
@@ -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 *"
|
||||
|
||||
@@ -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-)
|
||||
|
||||
Reference in New Issue
Block a user