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 Explorer Context Menu Integration not working for folder with square brackets in its name #1374

Closed
adamgauthier opened this issue Dec 27, 2017 · 15 comments

Comments

@adamgauthier
Copy link

Versions

ConEmu build: 171217 x64
OS version: Windows 10 Pro 1709 Build 16299.125 x64
Used shell version: powershell

Problem description

When using the shell integration feature to open ConEmu in a directory that happens to contain "[" or "]" in its name, the shell won't open in the folder and will either default to "C:\Windows\System32\WindowsPowerShell\v1.0" or "C:". I think this might be related to these characters being used by PowerShell for wildcards. Let's say you open PowerShell in the parent directory and try to cd in it, you will have to escape the brackets for it to work (cd '.\te[st' -> cd '.\te`[st'). More info here. I'm sorry if I'm missing something or if this was reported in the past, couldn't find it while searching in issues.

Steps to reproduce

  1. Open ConEmu settings and go into the Integration tab.
  2. Register a "ConEmu Here" explorer context menu integration with the command "/single -run {powershell} -cur_console:a".
  3. Create a folder named "T[e]st" in "C:".
  4. Open the folder in the explorer and right click in it.
  5. Click on "ConEmu Here".

Actual results

ConEmu opens PowerShell in "C:\Windows\System32\WindowsPowerShell\v1.0"

Expected results

ConEmu opens PowerShell in "C:\T[e]st"

Thanks for looking into it, would love to see it fixed. I hope this isn't a third party problem.

@Maximus5
Copy link
Owner

I don't think it's related to brackets.
Did you check it with a folder without brackets?
What is your {powershell} task contents?

@adamgauthier
Copy link
Author

Yes, I did check it with a folder without brackets, I use the Windows Explorer Context Menu Integration feature all the time. I happened to use it with a folder with brackets today and was surprised that it didn't work. I use default tasks from when you install ConEmu, didn't change anything.

@Maximus5
Copy link
Owner

Don't you have /dir something in {PowerShell} task parameters?

@adamgauthier
Copy link
Author

No, I don't. As a matter of fact, I just reset all my settings to the defaults, and unregistered the integration then registered it again. The same behavior is observed.

@Maximus5
Copy link
Owner

Try to run {cmd} instead of {powershell}. What happens?

@adamgauthier
Copy link
Author

Ok, just registered /single -run {cmd} -cur_console:a in the Integration menu, and the issue is not present.

@Maximus5
Copy link
Owner

Than it's not a ConEmu problem.
To be sure, in that {cmd} console (are you in C:\T[e]st?) run powershell.exe and see what happens.

@adamgauthier
Copy link
Author

When running powershell.exe while in a folder with brackets in its name with cmd does indeed produce the same problem. Is there really no workaround for this? It would be great to be able to fix this problem cause I doubt microsoft will be willing to do it in a short amount of time.

@Maximus5 Maximus5 added this to In progress in ConEmu Dec 27, 2017
Maximus5 added a commit that referenced this issue Dec 27, 2017
…e folder, if starting task has `/dir %CD%` in the task parameters.
@Maximus5
Copy link
Owner

PowerShell must retain the current directory of the parent process. And it does on my PC regardless of brackets in dir name.

Try PowerShell.exe -noprofile.

@adamgauthier
Copy link
Author

Running powershell.exe -noprofile in cmd while in the brackets folder yields the same results. Not sure what I'm doing wrong.

@Maximus5
Copy link
Owner

This should be forwarded to Microsoft PowerShell team.

@Maximus5
Copy link
Owner

The last check: did you try to run PowerShell from cmd from T[e]st without ConEmu?

@adamgauthier
Copy link
Author

I just tried it, it does have the same problem. I'm sorry, I didn't know this was a third party issue.

@Maximus5 Maximus5 moved this from In progress to Done in ConEmu Dec 27, 2017
@Maximus5
Copy link
Owner

It's recommended to post your issue in the Microsoft Community forum for advance troubleshooting about your issue on powershell: https://goo.gl/oGbY7a

@adamgauthier
Copy link
Author

Thanks, I opened an issue on their GitHub instead (PowerShell/PowerShell/issues/5752).

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

No branches or pull requests

2 participants