Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

:cd not working on Windows with v0.6 #1439

Closed
superlou opened this issue Jan 4, 2022 · 16 comments
Closed

:cd not working on Windows with v0.6 #1439

superlou opened this issue Jan 4, 2022 · 16 comments
Labels
A-helix-term Area: Helix term improvements C-bug Category: This is a bug

Comments

@superlou
Copy link
Contributor

superlou commented Jan 4, 2022

Reproduction steps

  1. Run hx in the command prompt
  2. Try to cd to a different folder, e.g. "C:\opt"
  3. Receive the error "Couldn't change the current working directory: The system cannot find the file specified. (os error 2)"

image

The expected behavior (release v0.5) is:

image

Environment

  • Platform: Windows 10
  • Helix version: v0.6 release (hx -V prints "helix")
~/.cache/helix/helix.log (C:\Users\lsimons\AppData\Local\helix is empty)
@superlou superlou added the C-bug Category: This is a bug label Jan 4, 2022
@archseer
Copy link
Member

archseer commented Jan 4, 2022

\cc @ath3 could this be due to #1389 #1231 ?

@superlou can you replicate it on 3307f44 ? (One commit before #1231 got merged)

@superlou
Copy link
Contributor Author

superlou commented Jan 4, 2022

Unfortunately, I can't build on a Windows computer: our office Rust version is too old and I use Linux at home. I'll see if I can get our tool-chain updated.

@archseer
Copy link
Member

archseer commented Jan 4, 2022

@kirawi You are on Windows right? Can you try to narrow it down?

@kirawi kirawi added the A-helix-term Area: Helix term improvements label Jan 4, 2022
@kirawi
Copy link
Member

kirawi commented Jan 4, 2022

I'm not sure if it's the same issue, but trying to :open a directory would give an unable to open <directory> error in the status line. Before, I believe it would have opened the file picker?

@superlou
Copy link
Contributor Author

superlou commented Jan 4, 2022

It definitely seems like it's related to Windows vs. Unix style paths. If I do :cd C:/opt (note the forward slash) it completes successfully:

image

Also, autocompleting paths on Windows seems to work so long as I use forward slashes.

@kirawi
Copy link
Member

kirawi commented Jan 4, 2022

It seems like it wants to escape the backslash, so C:\\ works while C:\ doesn't.

@archseer
Copy link
Member

archseer commented Jan 4, 2022

I thought the fix for #1389 was odd, rather than converting Windows backslashes to slashes, it should patch the shellwords handling to work with backslashes if cfg(windows) I think?

@kirawi
Copy link
Member

kirawi commented Jan 4, 2022

Yep, I can do that since I worked with shellwords' source for another project.

@archseer
Copy link
Member

archseer commented Jan 4, 2022

We don't import shellwords, we have our own implementation.

@archseer
Copy link
Member

archseer commented Jan 4, 2022

@archseer
Copy link
Member

archseer commented Jan 4, 2022

An easy quickfix for the time being would be revert #1389 and conditionally use shellwords if we're not on windows, otherwise just split string on spaces like before.

@archseer
Copy link
Member

archseer commented Jan 5, 2022

Can someone test the latest master (7767703)? I also reverted #1389

@kirawi
Copy link
Member

kirawi commented Jan 5, 2022

Seems like it works, but I notice that typing e.g. ..\ shows
Capture2
instead of
Capture4

@archseer
Copy link
Member

archseer commented Jan 6, 2022

Yeah but that was present previously before, I just reverted back to the old behavior. Fixed now in 3e4f815

@archseer archseer closed this as completed Jan 6, 2022
@ChimpSpin
Copy link

Still getting this error if the path contains spaces.

@ath3
Copy link
Contributor

ath3 commented Jan 23, 2022

I will work on this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-helix-term Area: Helix term improvements C-bug Category: This is a bug
Projects
None yet
Development

No branches or pull requests

5 participants