lazycli
lazycli copied to clipboard
Let commands take over the terminal?
Is it possible to yield control of the terminal to each command when it runs? This would open up a bunch of new possibilities.
- Commands that use $EDITOR or $PAGER.
- From an
lsview, you could bindvim $0orless $0to a key. The editor would take over the terminal temporarily; when you quit the editor you'd be back in the same lazycli session. - From the
git statusview, you could rungit commitand let the commit-message editor take over temporarily. - From
git logyou could rungit show --patchto preview a commit.
- From an
- Commands that prompt for a second argument.
- From
ls, you could bindrtomv $0 $(read). Then to renamefootobaryou'd selectfoo, and typer bar<enter>. - Similarly, from
git branch, you could bindgit branch mv $0 $(read).
- From
I'm not sure how this would be implemented, but it might be similar to vim's :! command. As a (contrived) example, when you run :!htop, htop takes over the terminal; when you quit htop you end up back in vim again.