zedapp / zed

Rethinking code editing.
http://zedapp.org
MIT License
2.22k stars 162 forks source link

Zedd fails silently on malformed exposed filesystem #563

Open rfilmyer opened 9 years ago

rfilmyer commented 9 years ago

If I start zedd with a malformed --root command, like so:
zedd --remote --user=foo --pass='bar' --root=~/projects/ --port=58035

zedd won't give me any errors, but any attempt to open up a zedd instance through the zed chrome app will just appear like it's loading infinitely. The zedd terminal doesn't indicate what the problem is.

Zedd is now listening on http://0.0.0.0:58035 
Exposed filesystem : /Users/roger/~/projects 
Mode               : remote (externally accessible) 
Command execution  : disabled 
Authentication     : enabled
POST /
GET /

Hypothetically, either zedd should give me an error at start saying that this directory doesn't exist, or Zed should return an error on trying to connect.

rfilmyer commented 9 years ago

Trying to tease out this bug even more, here's what I've found about zedd's path resolution (on OS X)

bash-3.2$ pwd
/Users/roger/Desktop
bash-3.2$ zedd --root=../projects                                               
Zedd is now listening on http://127.0.0.1:7337 
Exposed filesystem : /Users/roger/projects 
[...]
bash-3.2$ zedd --root=./projects
Zedd is now listening on http://127.0.0.1:7337 
Exposed filesystem : /Users/roger/Desktop/projects
[...]

(although note that ~/Desktop/projects/ does not exist)

bash-3.2$ zedd --root=~/projects
Zedd is now listening on http://127.0.0.1:7337 
Exposed filesystem : /Users/roger/Desktop/~/projects 
[...]

Presumably the last one isn't expected behavior.