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
louistio opened this Issue Dec 27, 2017 · 15 comments

Comments

Projects
2 participants
@louistio

louistio commented Dec 27, 2017

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

This comment has been minimized.

Show comment
Hide comment
@Maximus5

Maximus5 Dec 27, 2017

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?

Owner

Maximus5 commented Dec 27, 2017

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

@Maximus5 Maximus5 added the settings label Dec 27, 2017

@louistio

This comment has been minimized.

Show comment
Hide comment
@louistio

louistio Dec 27, 2017

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.

louistio commented Dec 27, 2017

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

This comment has been minimized.

Show comment
Hide comment
@Maximus5

Maximus5 Dec 27, 2017

Owner

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

Owner

Maximus5 commented Dec 27, 2017

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

@louistio

This comment has been minimized.

Show comment
Hide comment
@louistio

louistio Dec 27, 2017

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.

louistio commented Dec 27, 2017

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

This comment has been minimized.

Show comment
Hide comment
@Maximus5

Maximus5 Dec 27, 2017

Owner

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

Owner

Maximus5 commented Dec 27, 2017

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

@louistio

This comment has been minimized.

Show comment
Hide comment
@louistio

louistio Dec 27, 2017

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

louistio commented Dec 27, 2017

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

@Maximus5

This comment has been minimized.

Show comment
Hide comment
@Maximus5

Maximus5 Dec 27, 2017

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.

Owner

Maximus5 commented Dec 27, 2017

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.

@louistio

This comment has been minimized.

Show comment
Hide comment
@louistio

louistio Dec 27, 2017

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.

louistio commented Dec 27, 2017

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

gh-1374: Explorer context menu integration didn't start console in th…
…e folder, if starting task has `/dir %CD%` in the task parameters.
@Maximus5

This comment has been minimized.

Show comment
Hide comment
@Maximus5

Maximus5 Dec 27, 2017

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.

Owner

Maximus5 commented Dec 27, 2017

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.

@louistio

This comment has been minimized.

Show comment
Hide comment
@louistio

louistio Dec 27, 2017

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

louistio commented Dec 27, 2017

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

@Maximus5

This comment has been minimized.

Show comment
Hide comment
@Maximus5

Maximus5 Dec 27, 2017

Owner

This should be forwarded to Microsoft PowerShell team.

Owner

Maximus5 commented Dec 27, 2017

This should be forwarded to Microsoft PowerShell team.

@Maximus5 Maximus5 added other-powershell and removed settings labels Dec 27, 2017

@Maximus5

This comment has been minimized.

Show comment
Hide comment
@Maximus5

Maximus5 Dec 27, 2017

Owner

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

Owner

Maximus5 commented Dec 27, 2017

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

@louistio

This comment has been minimized.

Show comment
Hide comment
@louistio

louistio Dec 27, 2017

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

louistio commented Dec 27, 2017

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

This comment has been minimized.

Show comment
Hide comment
@Maximus5

Maximus5 Dec 27, 2017

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

Owner

Maximus5 commented Dec 27, 2017

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

@louistio

This comment has been minimized.

Show comment
Hide comment
@louistio

louistio Dec 28, 2017

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

louistio commented Dec 28, 2017

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

@Maximus5 Maximus5 closed this Dec 28, 2017

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