Let commands take over the terminal?
dpercy opened this issue · comments
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 bind
less $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 run
git commitand let the commit-message editor take over temporarily.
git logyou could run
git show --patchto preview a commit.
- From an
- Commands that prompt for a second argument.
ls, you could bind
mv $0 $(read). Then to rename
foo, and type
- Similarly, from
git branch, you could bind
git branch mv $0 $(read).
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.