Collectives™ on Stack Overflow
Find centralized, trusted content and collaborate around the technologies you use most.
Learn more about Collectives
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
Learn more about Teams
I would like to
open vscode in the cwd and exit the Windows cmd terminal from which the command is issued at the same time
.
code .
(with a
.
for cwd) launches vscode in the cwd.
exit
closes the terminal. But as issuing the first command makes the terminal loses focus, I need to give it back to it to issue the second command.
I would like to type a
single line command that does both actions
at once, thus without the terminal losing its focus.
code . & exit
doesn't work as the terminal window remains open and hangs infinitely with a flashing cursor.
Ctrl-C
doesn't bring the cmd prompt back and clicking the upper right
x
is the only way to close the terminal window when in that state. (vscode opens correctly in the cwd thought.)
How to do so?
–
–
–
Thanks for contributing an answer to Stack Overflow!
-
Please be sure to
answer the question
. Provide details and share your research!
But
avoid
…
-
Asking for help, clarification, or responding to other answers.
-
Making statements based on opinion; back them up with references or personal experience.
To learn more, see our
tips on writing great answers
.