feat(cli): zellij run improvements #1804
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR does several things:
command
part of the various CLI pane-opening commands has been moved to the last part after double-dashes as per convention. egzellij run --floating -- tail -f /tmp/my_nice_output.log
- this is in order to prevent ambiguity and mistakes when providing commands with arguments.--name
, eg.zellij run --name "my tests" -- cargo test
zp
(short for "zellij pane") ===> shortcut forzellij run -- <arguments>
, eg.zp cargo test
(notice the lack of quotations!)zpf
(short for "zellij pane floating") - same as above with the--floating
flag to open a floating pane.zo
(short for "zellij open") ===> shortcut forzellij edit <arguments>
, eg.zo /tmp/my-file.txt
will openmy-file
in your default editor (eg. vim)zof
(short for "zellij open floating") - same as above with the--floating
flag to open a floating pane.A "hidden" feature of the shell completions from point 3 is that they wrap the provided command with the relevant shell's
-c
flag (eg. bash -c "cargo test") - with this, shell aliases and built-ins such asll
in fish will work out of the box.@raphCode - if you have a chance (even after I merge this) to check out the bash and zsh functions I created to make sure I didn't do any faux pas, that would be great. :)
EDIT: the reason for the alias name change (eg.
zp
instead ofzr
andzo
instead ofze
) is that I felt these aliases will be easier and quicker to type, because the command is spread over both hands on the keyboard. Since these are commands that advanced users will probably be using a lot, I thought it would be nice to start with a sane default.