mirror of
https://github.com/fish-shell/fish-shell.git
synced 2026-05-21 03:21:16 -03:00
Update %self references with $pid instead
This commit is contained in:
@@ -1,11 +1,10 @@
|
||||
function __fish_complete_pids -d "Print a list of process identifiers along with brief descriptions"
|
||||
# This may be a bit slower, but it's nice - having the tty displayed is really handy
|
||||
# 'tail -n +2' deletes the first line, which contains the headers
|
||||
# %self is removed from output by string match -r -v
|
||||
set -l SELF %self
|
||||
# $pid is removed from output by string match -r -v
|
||||
|
||||
# Display the tty if available
|
||||
# But not if it's just question marks, meaning no tty
|
||||
ps axc -o pid,ucomm,tty | string match -r -v '^\s*'$SELF'\s' | tail -n +2 | string replace -r ' *([0-9]+) +([^ ].*[^ ]|[^ ]) +([^ ]+) *$' '$1\t$2 [$3]' | string replace -r ' *\[\?*\] *$' ''
|
||||
ps axc -o pid,ucomm,tty | string match -r -v '^\s*'$pid'\s' | tail -n +2 | string replace -r ' *([0-9]+) +([^ ].*[^ ]|[^ ]) +([^ ]+) *$' '$1\t$2 [$3]' | string replace -r ' *\[\?*\] *$' ''
|
||||
end
|
||||
|
||||
|
||||
@@ -6,9 +6,9 @@ function edit_command_buffer --description 'Edit the command buffer in an extern
|
||||
else
|
||||
# We should never execute this block but better to be paranoid.
|
||||
if set -q TMPDIR
|
||||
set f $TMPDIR/fish.(echo %self).fish
|
||||
set f $TMPDIR/fish.$pid.fish
|
||||
else
|
||||
set f /tmp/fish.(echo %self).fish
|
||||
set f /tmp/fish.$pid.fish
|
||||
end
|
||||
touch $f
|
||||
or return 1
|
||||
|
||||
@@ -18,11 +18,11 @@ function suspend --description 'Suspend the current shell.'
|
||||
end
|
||||
|
||||
if status is-interactive
|
||||
echo -ns 'Suspending ' %self ': run'
|
||||
echo -n (set_color --bold) 'kill -CONT' %self (set_color normal)
|
||||
echo -ns 'Suspending ' $pid ': run'
|
||||
echo -n (set_color --bold) 'kill -CONT' $pid (set_color normal)
|
||||
echo 'from another terminal to resume'
|
||||
end
|
||||
|
||||
# XXX always causes a zombie until one fg's when we do this:
|
||||
kill -STOP %self
|
||||
kill -STOP $pid
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user