coder / code-server

VS Code in the browser
https://coder.com
MIT License
68.65k stars 5.64k forks source link

Expand `~` from config #7051

Open ForteDexe opened 4 weeks ago

ForteDexe commented 4 weeks ago

Is there an existing issue for this?

OS/Web Information

Steps to Reproduce

  1. add this user-data-dir: ~/.config/code-server-data to config.yaml
  2. run command code-server

Expected

~/.config/code-server-data

Actual

But in the web browser, it will be:

~/~/.config/code-server-data

Note

I get it now, depends on where the current directory in the terminal is, code-server will use the current directory plus user-data-dir

code-asher commented 3 weeks ago

~ is normally expanded by the shell, so it would not get expanded in a YAML config. But, it would be nice if we manually expand it when we read the config.

ForteDexe commented 3 weeks ago

If run as the services, using ~ it recognizes the user-data folder well But other stuff might not, ie:

[error] Unable to read file '/~/.config/code-server-user-data/extensions/extensions.json' (Error: Unable to resolve nonexistent file '/~/.config/code-server-user-data/extensions/extensions.json'): Error: Unable to read file '/~/.config/code-server-user-data/extensions/extensions.json' (Error: Unable to resolve nonexistent file '/~/.config/code-server-user-data/extensions/extensions.json')