hharnisc / hypercwd

Opens new tabs with the same directory as the current tab in Hyper
MIT License
385 stars 39 forks source link

Fix opening new tab in directories with spaces #3

Closed tkatchenko closed 8 years ago

tkatchenko commented 8 years ago

When opening a new tab in a directory that contained spaces I was getting an exception so I replaced the awk script with tr (to trim extra whitespace) and cut (to get everything from the ninth field, including spaces).

hharnisc commented 8 years ago

Could you share a few things?

Having some trouble reproducing on OS X with a directory named ~/Break\ It

tkatchenko commented 8 years ago

~/Break\ It breaks it for me, I get a popup with this message when trying to open a new tab from that directory:

A JavaScript error occurred in the main process
Uncaught Exception:
Error: spawn /Applications/HyperTerm.app/Contents/Resources/app/node_modules/child_pty/lib/../build/Release/exechelper ENOENT
    at exports._errnoException (util.js:949:11)
    at Process.ChildProcess._handle.onexit (internal/child_process.js:182:32)
    at onErrorNT (internal/child_process.js:348:16)
    at _combinedTickCallback (internal/process/next_tick.js:74:11)
    at process._tickCallback (internal/process/next_tick.js:98:9)

With no errors in the developer console.

Running on OS X 10.11.5 and HyperTerm 0.7.1.36 with no other plugins.

tkatchenko commented 8 years ago

Also, if I grab the PID of my shell and run lsof -p 88229 | grep cwd | awk '$4 == "cwd" {print $9}' it returns /Users/thomas/Break instead of /Users/thomas/Break It.

hharnisc commented 8 years ago

Thanks for the input! I was able to reproduce this locally (had some reloading confusion on my end). Works great, thanks for the fix @thank-etc-ok!

tkatchenko commented 8 years ago

Glad to help! 👌