2

When you start a Codespace, it puts you in /workspaces/repoName, both in the terminal and the sidebar file explorer.

From the terminal, you can cd / into the top level directory, and do command-line stuff.

But the file explorer can't seem to navigate "up" directories past workspaces/repoName.

From desktop VSCode, you can connect to a GitHub Codespace and cd / && code . to open a new editor in the top level directory, but it's clunky and opens a separate editor.

Is there a way to set the GUI file explorer to open at the top level directory?

ultraGentle
  • 5,084
  • 1
  • 19
  • 45

1 Answers1

1

Add ?folder=/ to the end of the Codespace URI to open it in the root directory. This makes the URI look like https://username-repo-random.github.dev/?folder=/.

Alternatively, you can use the integrated terminal and run cd / && code . from there to open a new tab with the Codespace in the root directory. The opened Codespace will have ?folder=/ in the URI, so this is effectively equivalent to the other way I described.

smitop
  • 4,770
  • 2
  • 20
  • 53