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

[Windows] Automatically convert paths when pasted into bash #103

Open
NiklasRosenstein opened this issue Jun 22, 2018 · 2 comments
Open

Comments

@NiklasRosenstein
Copy link

NiklasRosenstein commented Jun 22, 2018

Cmder has this feature, though I can not tell you how they implemented it. If you are in a bash shell on Windows, Windows paths will be automatically converted to Unix-like paths when they are pasted. This is very useful!

Eg. pasting C:\Windows\System32 would be turned into /c/Windows/System32 when pasted under a Git for Windows Bash, but turned into /cygdrive/c/Windows/System32 when pasted under a Cygwin bash shell.

@NiklasRosenstein NiklasRosenstein changed the title Automatically convert paths on paste into bash on WIndows [Windows] Automatically convert paths when pasted into bash Jun 22, 2018
@NiklasRosenstein
Copy link
Author

If you can give me a point to start from in the extraterm source, I would be happy to try and contribute this feature.

@sedwards2009
Copy link
Owner

At some point in the future I would like to add some kind of Special Paste command which allowed for editing or transforming text before it is pasted. Converting paths would fit into that. I don't have that yet, but what you could try is adding a special command to convert any path in the clipboard and then 'type' it into the terminal.

Extraterm has a little baby extension/plugin system and the extensions live under the extensions directory on github. The InjectShellIntegration extension demonstrates most of what you want. It can insert text into the terminal and also add commands to the command palette. WindowsConsoleSessionEditor has a package.json file with the stuff needed to only allow that extension to load on Windows. What is missing is the ability to grab the contents of the clipboard. I would have to add that to the extension API. Also, the recent update to WSL added a small tool (wslpath.exe I think) which makes it possible to translate paths.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants