Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Search processes] allow multi-selection and clean up code a little #219

Merged
merged 9 commits into from
Jan 30, 2022

Conversation

PatrickF1
Copy link
Owner

No description provided.

@PatrickF1 PatrickF1 changed the title [Search processes] allow fzf multi-select [Search processes] allow fzf multi-select and clean up code a little Jan 30, 2022

### A commit hash
### Commit hashes
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This and Shell variables header should have been plural to represent the ability to select multiple of them

@@ -1,18 +1,21 @@
function _fzf_search_processes --description "Search all running processes. Replace the current token with the pid of the selected process."
set token (commandline --current-token)
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

moved into the call to _fzf_wrapper to simplify

--ansi \
--header-lines=1 \
--preview='ps -o pid,user,ppid,%cpu,rss,time,start,command -p {1}' \
$fzf_processes_opts
)

if test $status -eq 0
set pid_selected (string split --no-empty " " $process_selected)[1]
commandline --current-token --replace -- (string escape -- $pid_selected)
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

string escape was unnecessary

@@ -7,7 +7,7 @@ function fzf_configure_bindings --description "Installs the default key bindings
set options_spec h/help 'directory=?' 'git_log=?' 'git_status=?' 'history=?' 'variables=?' 'processes=?'
argparse --max-args=0 --ignore-unknown $options_spec -- $argv 2>/dev/null
if test $status -ne 0
echo "Invalid option or a positional argument was provided." 1>&2
echo "Invalid option or a positional argument was provided." >&2
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

out of scope change to make writing to stderr more consistent

@PatrickF1 PatrickF1 changed the title [Search processes] allow fzf multi-select and clean up code a little [Search processes] allow multi-select processes and clean up code a little Jan 30, 2022
@PatrickF1 PatrickF1 changed the title [Search processes] allow multi-select processes and clean up code a little [Search processes] allow multi-selection and clean up code a little Jan 30, 2022
@PatrickF1 PatrickF1 merged commit 5da06d5 into main Jan 30, 2022
@PatrickF1 PatrickF1 deleted the search-processes-followup branch January 30, 2022 00:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant