flexboxer
flexboxer

Reputation: 21

How to open directory from terminal in vs code? but inside the same window

I have vs code open and I'm using bash terminal within it, when I'm inside the directory I want to open I type code . and that opens everything I want but it opens a new vs code window. Is there a way it can open inside of the current vs code window I am in?

Upvotes: 2

Views: 244

Answers (1)

Mark
Mark

Reputation: 180631

Try code . -r to force opening in the same window. See https://code.visualstudio.com/docs/editor/command-line#_core-cli-options for more options in the command line.

For a more "permanent" solution there is this setting:

Window: Open Files In New Window

Controls whether files should open in a new window. Note that there can still be cases where this setting is ignored (e.g. when using the --new-window or --reuse-window command line option).

Set it to off and then ``code .` is enough.

Upvotes: 3

Related Questions