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

1.5.0.0 and spaces in filename #17

Closed
AeliusSaionji opened this issue Oct 2, 2022 · 10 comments
Closed

1.5.0.0 and spaces in filename #17

AeliusSaionji opened this issue Oct 2, 2022 · 10 comments

Comments

@AeliusSaionji
Copy link

I'm mostly sure this worked in the last release. Now I can't seem to find any escape sequence that works at all. Currently I have just one shell-x entry: [any] 02.Edit in gVim.cmd gvim %*

Is there a way to properly escape this, or is this a regression?

Thanks

@oleg-shilo
Copy link
Owner

Can you please explain what exactly does not work?
In #16 it was reported that the title was not incorrect in the menu for the cmd file with spaces. But after testing the very latest download from the release page @Ahernz confirmed it as working again.

Can you please download and try it again from the release https://github.com/oleg-shilo/shell-x/releases/tag/v1.5.0.0?
Or better yet install it from Choco (https://community.chocolatey.org/packages/shell-x/1.5.0.1). It was published a few hours ago.

If it does not work then please provide explanations on how to reproduce it.

@AeliusSaionji
Copy link
Author

Spaces are not escaped. This is 1.5.0.1 from chocolatey.

image

@AeliusSaionji
Copy link
Author

AeliusSaionji commented Oct 4, 2022

If it does not work then please provide explanations on how to reproduce it.

Use shell-x on any file with spaces in the name.
Command line arguments are separated by spaces. shell-x launches commands with arguments. Without quotations or escaping, filenames with spaces will be interpreted by all software as separate files. If a filename contains a space, it must be escaped or presented in quotes in order to be interpreted as one "argument".

shell-x current behavior:
image

shell-x desired behavior:
image

@oleg-shilo
Copy link
Owner

I am not sure what you are trying to do in these first screenshots. I see you are executing gvim in PowerShell.
I see no connection with the shell-x functionality. Am I missing something?

This is how I did the test:

  • Created a "multi-select" batch file for "any" file extension.
  • In the batch file inserted comment that prints info about the batch file start argument
    image
  • Selected multiple files with space in the name in the explorer and executed the new batch t\file for the selection
  • Observed multiple batch file execution with the correct (full) path of the selected file passed top the batch fil

issue#17

I suggest you do the same test to eliminate the possibility that the problem is caused by the the environment differences.

@AeliusSaionji
Copy link
Author

I am not sure what you are trying to do in these first screenshots. I see you are executing gvim in PowerShell.
Am I missing something?

Perhaps you are not understanding because you are thinking I'm having a nuanced and / or complex problem.

It's as simple and as basic as this: a filename containing spaces needs to be escaped.

This is how I did the test:

image

It appears that .ms fixes the problem, so the bug is in shell-x's behavior without .ms.

@AeliusSaionji
Copy link
Author

AeliusSaionji commented Oct 6, 2022

Here's a modified version of your test that can be repeated in a normal cmd such that success is more apparent in screenshots.

04.Test.c.cmd

type %*
pause

The output shows the problem is actually that it is double quoted twice, which negates the double quotes.
image

In this cmd, I repeat the invalid command shell-x sent, demonstrate the correct command, and last demonstrate that the command can't work unless the spaces are handled in some way.

image

And now let's look at what adding .ms does to the command:
image

The inclusion of .ms causes shell-x to correctly deploy one pair of doublequotes.

@oleg-shilo
Copy link
Owner

oleg-shilo commented Oct 6, 2022

Perhaps you are not understanding because you are thinking I'm having a nuanced and/or complex problem.
It's as simple and as basic as this: a filename containing spaces need to be escaped.

😄 No, I understand what you are experiencing. You described the symptoms well. But I need to understand how you trigger this behaviour so I can understand where the handling of spaces needs to happen. So I need to be able to reproduce this problem.

Your very last post gave me enough info and now I can reproduce it. All good.

@oleg-shilo
Copy link
Owner

Done.

I have made a pre-release for you to test. If the fix works, I will publish it right away.
https://github.com/oleg-shilo/shell-x/releases/tag/v1.5.1.0

@AeliusSaionji
Copy link
Author

Seems good - thanks! Sorry for not being clear enough. Guess I shouldn't assume gVim's interface is particularly intuitive 😄

image

@oleg-shilo
Copy link
Owner

Done, published on Choco

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

No branches or pull requests

2 participants