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

Sanitize paths when pasting into a bash shell #1858

Closed
axfelix opened this issue Jul 7, 2019 · 2 comments
Closed

Sanitize paths when pasting into a bash shell #1858

axfelix opened this issue Jul 7, 2019 · 2 comments
Labels
Issue-Feature Complex enough to require an in depth planning process and actual budgeted, scheduled work. Resolution-Duplicate There's another issue on the tracker that's pretty much the same thing.

Comments

@axfelix
Copy link

axfelix commented Jul 7, 2019

Summary of the new feature/enhancement

Not sure if this is out of scope, but it would be nice if Windows Terminal could automatically sanitize paths (e.g. quoting spaces, inverting or escaping Windows-style slashes) when pasting to a non-cmd, non-Powershell environment. ConEmu's Far Manager does this and it makes mingw bash much more usable.

Proposed technical implementation details (optional)

Automatically make assumptions about the running shell and change pasted paths to match the interpreter flavour.

P.S.: Just noticed you already fixed the Windows Terminal gsyncing my entire desktop when it's focused, thanks! If you add this feature and a warning on quitting when you have an ssh connection open or another running program, I'll be really happy to switch to using Windows Terminal fulltime!

@axfelix axfelix added the Issue-Feature Complex enough to require an in depth planning process and actual budgeted, scheduled work. label Jul 7, 2019
@ghost ghost added Needs-Triage It's a new issue that the core contributor team needs to triage at the next triage meeting Needs-Tag-Fix Doesn't match tag requirements labels Jul 7, 2019
@DHowett-MSFT
Copy link
Contributor

DHowett-MSFT commented Jul 7, 2019

This'll also be related to #904 and #331; there's a bunch of pain in "detecting" on both sides of this problem.

The first is pain in detecting what is a path; for example, /Windows is a valid path to powershell on Windows, but it looks like an absolute WSL path. Blindly taking things off the clipboard and trying to access-check them is a recipe for a bad time, too, because that'll almost certainly bother more than one antivirus solution. Blindly taking things off the clipboard and trying to access-check them as WSL paths (for conversion back to Windows) is even more a recipe for a bad time, for the aforementioned^ and because WT cannot access check within your WSL distributions.

The second is detecting what the shell is on the other end of the terminal. For local shells it's possible, although easily fooled (wsl -> powershell.exe -> cmd.exe should be detected as cmd but the terminal only knows about wsl), and for remote shells it is impossible in the general case. 😄

@DHowett-MSFT
Copy link
Contributor

Also, this is #1772 😄

@DHowett-MSFT DHowett-MSFT added the Resolution-Duplicate There's another issue on the tracker that's pretty much the same thing. label Jul 8, 2019
@ghost ghost removed the Needs-Tag-Fix Doesn't match tag requirements label Jul 8, 2019
@DHowett-MSFT DHowett-MSFT added Needs-Tag-Fix Doesn't match tag requirements and removed Needs-Triage It's a new issue that the core contributor team needs to triage at the next triage meeting labels Jul 8, 2019
@ghost ghost removed the Needs-Tag-Fix Doesn't match tag requirements label Jul 8, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Issue-Feature Complex enough to require an in depth planning process and actual budgeted, scheduled work. Resolution-Duplicate There's another issue on the tracker that's pretty much the same thing.
Projects
None yet
Development

No branches or pull requests

2 participants