https://bugs.kde.org/show_bug.cgi?id=436374

            Bug ID: 436374
           Summary: KDE Connect run command plugin on windows problems
                    with quote
           Product: kdeconnect
           Version: unspecified
          Platform: Microsoft Windows
                OS: Microsoft Windows
            Status: REPORTED
          Severity: normal
          Priority: NOR
         Component: common
          Assignee: albertv...@gmail.com
          Reporter: bijaf45...@quossum.com
  Target Milestone: ---

SUMMARY

I'm not sure exactly how broken this is, but when i try to run a command with
quotes in it (parameters with spaces) the command doesn't run successfuly.

I tried running nircmd.exe (https://www.nirsoft.net/utils/nircmd.html) program
to speak text with parameters:
nircmd.exe speak text "Hello world asd asd" 2

the command expects [speak] [text] [Text to speak] [speak rate] [volume]
but the computer spoke
Backslash Hello world asd asd Backslash

So it somehow understands that the text i put between the quotes is just one
argument (it doesn't overwrite speak rate and volume), but it adds backslashes
somewhere.
I tried editing the config file in the AppData folder and removing some
backslashes there, but it deleted all of my commands.
I also tried looking at the source code, but I don't understand much C++

For writing this report, I created a simple executable that just writes its
arguments to a file, with the following C# code:
public class a{
    public static void Main(string[] args){
        File.AppendAllText("D:\\args.txt", args.Length.ToString() + "
Values:\r\n");
        for(int i=0; i<args.Length; i++){
            File.AppendAllText("D:\\args.txt", args[i]);
            File.AppendAllText("D:\\args.txt", "\r\n");
}}}

And now that program says it gets 7 arguments when i run with the same
commands. (It doesn't accept quoted string as a single command, while if i run
it from command line, it does.)
It says the third argument starts with a quote and sixth one ends with a quote.



STEPS TO REPRODUCE

1. Be on Windows
2. Create a Command that uses quotes in the command
3. Watch it break in different ways


OBSERVED RESULT

While the nircmd.exe program gets the argument with additional backslashes, my
test program gets each word in the arguments seperately.


EXPECTED RESULT

Both of the commands to work like executing with them with cmd /k as
runplugincommand.cpp tries to do


SOFTWARE/OS VERSIONS

Windows: Windows 10 1909 - Kde connect 1.4-573
Android: 1.16


ADDITIONAL INFORMATION

-- 
You are receiving this mail because:
You are watching all bug changes.

Reply via email to