jesseduffield/lazycli

Let commands take over the terminal?

Opened this issue · 0 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.

  1. Commands that use $EDITOR or $PAGER.
    • From an ls view, you could bind vim $0 or less $0 to 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 status view, you could run git commit and let the commit-message editor take over temporarily.
    • From git log you could run git show --patch to preview a commit.
  2. Commands that prompt for a second argument.
    • From ls, you could bind r to mv $0 $(read). Then to rename foo to bar you'd select foo, and type r bar<enter>.
    • 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.