Block Query 🚀

How to prevent Visual Studio Code from always reopening the previous files or folders

February 18, 2025

đź“‚ Categories: Programming
🏷 Tags: Visual-Studio-Code
How to prevent Visual Studio Code from always reopening the previous files or folders

Beat of Ocular Workplace Codification (VS Codification) launching with a graveyard of ancient tasks? You’re not unsocial. Galore builders discovery this “characteristic” disruptive, pulling them backmost into yesterday’s codification once they’re fit to deal with present’s challenges. This usher volition locomotion you done however to configure VS Codification to unfastened caller, permitting you to direction connected the project astatine manus and enhance your coding productiveness. We’ll screen settings changes, workspace direction, and champion practices to support your VS Codification startup cleanable and businesslike.

Knowing VS Codification’s Startup Behaviour

VS Codification’s default behaviour is to reconstruct your former conference, together with opened records-data and folders. This tin beryllium adjuvant for continuity, however frequently turns into an impediment once switching betwixt antithetic tasks. Knowing wherefore VS Codification does this is the archetypal measure in the direction of controlling it.

VS Codification goals to supply a seamless education, selecting ahead wherever you near disconnected. Nevertheless, this comfort tin pb to a cluttered workspace and dilatory startup instances, particularly if you recurrently activity with many records-data oregon ample tasks. This computerized restoration stems from settings that power however VS Codification handles periods and workspaces.

Controlling Startup with Settings

The center of managing VS Codification’s startup lies inside its settings. Present’s wherever you tin good-tune its behaviour to lucifer your workflow.

Archetypal, navigate to Settings (Record > Preferences > Settings oregon Codification > Preferences > Settings connected macOS). Hunt for “reconstruct former conference” and you’ll discovery the important mounting: framework.restoreWindows. This mounting has respective choices: “each”, “no”, “1”, and “sphere”.

  1. “no”: This prevents VS Codification from reopening immoderate former home windows oregon information. This is the cleanest action for a caller commencement all clip.
  2. “1”: VS Codification volition unfastened lone the past progressive framework from your former conference.
  3. “each”: Restores each home windows and records-data from your past conference. This is the default mounting.
  4. “sphere”: Akin to “each,” however besides remembers the structure of your application teams.

Selecting “no” is mostly the about effectual resolution for stopping undesirable record reopening. Nevertheless, “1” tin beryllium utile if you persistently activity inside a azygous task.

Leveraging Workspaces for Task Direction

VS Codification workspaces supply a almighty manner to form initiatives and power which records-data unfastened connected startup. A workspace is basically a postulation of folders and settings circumstantial to a task. By utilizing workspaces, you tin isolate your initiatives and forestall undesirable information from cluttering your situation.

To make a workspace, merely unfastened your task folder successful VS Codification, past spell to Record > Prevention Workspace Arsenic. This volition make a .codification-workspace record. Once you unfastened this record, VS Codification volition burden lone the folders and settings related with that workspace, giving you a cleanable and centered situation. This is a extremely beneficial pattern for managing aggregate initiatives.

  • Retains initiatives abstracted and organized.
  • Supplies a cleanable startup education.

Bid Formation Choices and Precocious Configurations

For much granular power, you tin make the most of bid-formation choices. For case, launching VS Codification with the –fresh-framework statement volition ever unfastened a fresh, bare framework, careless of your settings. This is peculiarly utile for rapidly beginning a fresh case of VS Codification with out immoderate former baggage.

You tin besides make antithetic VS Codification person profiles, all with its ain settings and extensions. This is generous for separating activity and individual initiatives oregon antithetic improvement environments. Seat the authoritative VS Codification documentation for much accusation connected profiles and bid-formation arguments.

See extensions similar “Task Director” for simpler switching betwixt initiatives. These extensions tin streamline workflow and heighten your power complete VS Codification’s startup behaviour.

Champion Practices for a Cleanable VS Codification Startup

Present are any champion practices to keep a cleanable VS Codification startup:

  • Repeatedly adjacent pointless information and application teams.
  • Usage workspaces for task direction.
  • Customise your framework.restoreWindows mounting.
  • Research bid-formation arguments for much power.

By incorporating these practices, you tin change VS Codification from a origin of vexation to a almighty, targeted improvement situation.

Switching to a much managed startup procedure tin importantly better your improvement workflow. It permits you to dive consecutive into the applicable discourse with out the distraction of ancient initiatives. Experimentation with the antithetic settings and discovery what plant champion for you. A fine-configured VS Codification is a blessed VS Codification!

Larn much astir businesslike coding practices. FAQ
Q: Tin I alteration the startup behaviour for circumstantial workspaces?
A: Piece the framework.restoreWindows mounting is planetary, utilizing workspaces efficaciously isolates initiatives and supplies a cleanable slate for all workspace.

Fit to reclaim your VS Codification startup? Instrumentality these methods present and education a much targeted and businesslike coding situation. Cheque retired further sources connected VS Codification workspace direction and authoritative VS Codification documentation to additional heighten your workflow. See exploring associated matters similar VS Codification extensions for productiveness and suggestions for optimizing VS Codification show to maximize your coding ratio. Research precocious settings choices present.

Question & Answer :
Ocular Workplace Codification ever appears to retrieve my conference and reopen the records-data and/oregon tasks that have been unfastened the past clip I utilized it. It evidently behaves accurately once moving it from the bid formation with a record oregon folder provided, however once beginning from a taskbar shortcut, I’d similar it to default to an bare situation.

Is location immoderate manner to alteration this behaviour?

You tin besides spell into your settings and usage the pursuing:

“framework.reopenFolders”: “no”

which volition not reopen the folders you had been running connected once you closed the application. The another choices are 1 (the default) and each.

Edit 2017-eleven-09:

The action is present modified successful newest variations.

"framework.restoreWindows": "no" 

Seat Mathieu DOMER’s reply.

Edit 2018-09-12:

Different mounting associated to this is the hotExit mounting. This has been mentioned successful this reply to a associated motion. To forestall reopening and remembering unsaved information, you tin fit this to:

"information.hotExit": "disconnected" 

However from the trial I’ve made, once the framework.restoreWindows mounting is fit to no, this is not wanted. I haven’t examined all imaginable operation, truthful YMMV.

And to reply a motion successful the feedback, to edit the settings, you person to unfastened the settings record. Any documentation tin beryllium recovered present (astatine slightest connected the day I americium penning this).

Edit 2022-03-sixteen:

If you like utilizing a GUI to alteration the settings, seat D’Arcy Rittich’s reply.