DEV Community

Cover image for VS Code Tip of the Week: Terminal Auto Replies
Nick Taylor Subscriber for VS Code Tips

Posted on • Originally published at community.vscodetips.com

VS Code Tip of the Week: Terminal Auto Replies

This week's VS Code Tip came out in January of this year, but it seemed to go under the radar for me.

Automatic replies for the terminal allow you to do automatically answer terminal prompts, like Terminate batch job (Y/N)?? As a developer, that's something you will typically say yes to, so you can configure the VS Code integrated terminal to handle this!

You can add a section to your user settings called terminal.integrated.autoReplies.

I mostly use the integrated terminal, and one prompt I get occasionally that I never want to answer yes to is when it asks me to source the .env file of a project, so I've gone ahead and added the following to my configuration.

"terminal.integrated.autoReplies": {
  "dotenv: found '.env' file. Source it? ([Y]es/[n]o/[a]lways/n[e]ver)": "e\r"
}
Enter fullscreen mode Exit fullscreen mode

I just tried it as I'm writing this post and it works like a charm.

Happy VS Coding!

Top comments (3)

Collapse
 
waylonwalker profile image
Waylon Walker

That is a pretty sick tip, I've never seen anything like this. wonder if there is something outside of vscode that can also do this?

Collapse
 
rodelta profile image
Ro De la Rivera

If you use zsh, you can use a plugin
|github.com/johnhamelink/env-zsh

Collapse
 
nickytonline profile image
Nick Taylor

Yeah, I wonder. It would definitely be useful outside of VS Code for sure.