3 ms·
I'm apparently like you, none of this make sense to me. The CLI works like this: I type in a command, I get to see the result (if any) and back to step one. I
by kolme 11y ago
I'm apparently like you, none of this make sense to me.
The CLI works like this: I type in a command, I get to see the result (if any) and back to step one.
If doing a `cd` command takes 3 seconds, I'll have to wait for it to be ready to run the next command anyways, because my `rm` command has to run in there or I might have a problem.
For hasty typers like myself this could pretty easily backfire.
By the way, you can type the next command as the previous is running. You might get gibberish on screen, but you're sure it's only executed after the former is done.
Or you could just type several commands like `./configure && make` so that you can switch to something else in between.
In any case I don't see any advantages of an async prompt, just potential dangers.
- mtdewcmu 11y ago>> If doing a `cd` command takes 3 seconds, I'll have to wait for it to be ready to run the next command anyways, because my `rm` command has to run in there or I might have a problem. My understanding is that the cd command finishes before the next prompt gets displayed; the command that continues running in the background is `git status` inside the new working directory.
- daveloyall 11y ago> If doing a `cd` command takes 3 seconds, I'll have to wait for it to be ready to run the next command anyways, because my `rm` command has to run in there or I might have a problem. I think the CWD is actually changed before the PS1 magic queries for the status of the version control system--meaning that your `rm` would hit the correct target. But, I'm guessing--I haven't used a fancy prompt like this.
- akerl_ 11y agoPer the other response, this isn't delaying the cd, it's completing the cd and then delaying the loading of ancillary information to display asynchronously. More specifically put, this is a solution to a problem you don't have. Some people want their prompt to display more ancillary information about their environment. Those people want a quick, responsive prompt as much as you, and one of the strategies for having both processing this extra display info and having a fast prompt is async.
- kolme 11y ago_Edit:_ Replies below are right, it has to run the commands sequently for it to actually work somehow. Either way, it doesn't make much sense to me. For example, if `cd` fails you need to go back a few steps, etc.