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

--- Comment #4 from Keven L. Ates <atesc...@gmail.com> ---
(In reply to Ahmad Samir from comment #3)

So, yes, I understood the konsole process and, yes, konsole is the default
terminal emulator.  The structure of the grep command is irrelevant for the
example.  In fact the command is irrelevant.  I was pointing out that it
probably didn't matter where or how the "--config" option is supplied.  The
value after the option is used by some mechanism (konsole?) to
created/overwrite a file named by the value--even if the command fails.

For my test:
1. I opened konsole and executed this on the command line:
       konsole --noclose -e grep --console ~/Bin/test.cfg
   This did *not* produce the "test.cfg" file (as expected).

2. I created a .desktop file, "TermTest.desktop", containing:
      [Desktop Entry]
      Comment[en_US]=
      Comment=
      Exec=grep --config ~/Bin/test.cfg
      GenericName[en_US]=
      GenericName=
      Icon=network-server-database
      MimeType=
      Name[en_US]=TermTest
      Name=TermTest
      Path=/home/me/Bin
      StartupNotify=true
      Terminal=true
      TerminalOptions=\s--noclose
      Type=Application
      X-DBUS-ServiceName=
      X-DBUS-StartupType=none
      X-KDE-RunOnDiscreteGpu=false
      X-KDE-SubstituteUID=false
      X-KDE-Username=
NOTE: I found that the "Path" key must be set to an absolute directory. If I
set it to "~/Bin", the desktop file would not execute.  But, that's another
issue...

3. I double click the "TermTest.desktop" icon to execute.  The konsole app
opens and the command fails (as expected):
      [=============================================]
      [            TermTest -- Konsole              ]
      [                                             ]
      [ /bin/grep: unrecognized option '--config'   ]
      [ Usage: grep [OPTION]... PATTERNS [FILE]...  ]
      [ Try 'grep --help' for more information.     ]
      [                                             ]
      [=============================================]
However, a new file is generated in the ~/Bin directory, test.cfg (*not* as
expected):
      [MainWindow]
      State=AAAA/wAAAAD9AAAAAAAAAoAAAAHCAAAABAAAAAQAAAAIAAAACPwAAAAA
      ToolBarsMovable=Disabled
After the app is closed, the file, test.cfg, is updated:
      [Desktop Entry]
      DefaultProfile=

      [Favorite Profiles]
      Favorites=

      [MainWindow]
      State=AAAA/wAAAAD9AAAAAAAAAoAAAAHCAAAABAAAAAQAAAAIAAAACPwAAAAA
      ToolBarsMovable=Disabled

4. Doing as you suggested:
> export QT_LOGGING_RULES="*kio*=true;"
> dolphin
Double clicking the "TermTest.desktop" file creates a dialog asking to "open",
"execute", or "cancel".  Choosing "execute" produced no following results in
the terminal output.
<(from after you open the .desktop file) here.
So, there is nothing to post.  However, the same results for step 3 were
produced: test.cfg created (*not* as expected).

5. I changed the command in the .desktop file from "grep" to "xyzzy", a
non-existent command.  The same results for step 3 were produced: test.cfg
created (*not* as expected).  Of course, the output was different:


      Warning: Could not find 'xyzzy', starting '/bin/bash' instead.
      Please check your profile settings.

      /bin/bash: --config: invalid option
      Usage:  /bin/bash [GNU long option] [option] ...
              /bin/bash [GNU long option] [option] script-file ...
     ...blah, blah, blah...

6. I execute "TermTest.desktop" as per 3, but unchecked "Do not close when
command exits". The same end result for test 3 is produced: test.cfg created
(*not* as expected).

7. I execute "TermTest.desktop" as per 3, but unchecked "Run in terminal".  I
get a dialog: 
      [======================================]
      [           Sorry--Plasma              ]
      [                                      ]
      [  Could not find the program 'xyzzy'  ]
      [                                      ]
      [======================================]
No "test.cfg" file is produced (as expected).

So, obviously, the .desktop file process is executing some alien terminal
processing command that is taking the --config option as its own.  If it's
konsole, it is inconsistent with the konsole executed on the command line. 
Additionally, konsole does not report that it uses a --config option.

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

Reply via email to