While working in bash (usually with git), what often happens to me is that I start some command and while that command is executing (which could take a while), I want to start composing the next command to execute right away, without waiting for the previous command to finish. If I finish composing the next command while the previous command is still executing, the next command should wait for the previous to finish before it actually starts.
Inadequate options that I found so far are:
Just start writing the next command.
The problem with this is that I'm writing blind: I can type the next command, but I don't see what I'm typing. This is especially problematic when it comes to tab-completion, because it behaves "unpredictably" (e.g. it's hard for me to guess if
cd sTab will expand to
cd srcor not).
Execute the previous command on the background using
This means that the output of the previous command interleaves with the command I'm writing. The end result is that if the previous command outputs often enough, it's almost as bad as option #1.
Hide the output of the previous command using
The problem with this is that the output of the previous command is often important, especially in the case of failure.
To restate, is there some way to get an environment where:
- I can write the next command while the previous command executes
- I can see the command I'm writing
- tab-completion works normally
- output of the previous command is visible