3

VS Code Tip of the Week: Terminal Auto Replies

 1 year ago
source link: https://dev.to/vscodetips/vs-code-tip-of-the-week-terminal-auto-replies-58lg
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.

VS Code Tip of the Week 2022 (21 Part Series)

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"
}

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

Happy VS Coding!


About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK