Skip to content

Commit

Permalink
Merge remote-tracking branch 'refs/remotes/origin/main'
Browse files Browse the repository at this point in the history
  • Loading branch information
paulirish committed Oct 2, 2024
2 parents 52dbbbc + 2599dda commit d2ea238
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions fish/functions.fish
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,17 @@ function subl --description 'Open Sublime Text'
end


function killf
if ps -ef | sed 1d | fzf -m | awk '{print $2}' > $TMPDIR/fzf.result
kill -9 (cat $TMPDIR/fzf.result)
function kill_process --description 'Kill process that user selects in fzf (from ps aux output)'
set -l pid (ps aux | fzf -m --header-lines=1 | awk '{print $2}')

if test -n "$pid"
echo "Killing processes: $pid"
kill -9 $pid
end
end

# Select a port to kill, by pid, port, or command line
function kill_port

function kill_port --description 'Select a port to kill, by pid, port, or command line'

# Function to get the command line for a given PID
function get_command -a pid
Expand Down

0 comments on commit d2ea238

Please sign in to comment.