Bug 156826

Summary: quotes in profile command are not kept
Product: [Applications] konsole Reporter: Laurence <laurencevde>
Component: generalAssignee: Robert Knight <robertknight>
Status: RESOLVED FIXED    
Severity: normal CC: jim, shiningyu
Priority: NOR    
Version: unspecified   
Target Milestone: ---   
Platform: Compiled Sources   
OS: Linux   
Latest Commit: Version Fixed In:

Description Laurence 2008-01-28 02:26:56 UTC
Version:           2.1 (using Devel)
Installed from:    Compiled sources
Compiler:          gcc 4.1.2 
OS:                Linux

In the "Edit profile..."-dialog, when I try to set a command with quotes or double quotes in them, the quotes are not saved (but it still works in the current konsole). So, when I set set command: su -c "screen -R" ,I can start that session in the current konsole, but when I go back to the profile-editing-dialog, the quotes are gone, and the session won't work after restarting konsole.
Comment 1 Steven Schwartfeger 2008-01-28 02:51:36 UTC
Finally found the report :) I don't know how the process here goes, but I can confirm this, as I use su -c "screen -R -S Admin" often.

The version is whatever comes with kde-4.0.0, but from comparing my source to HEAD it looks the same, quotes are stripped out for some reason (in ShellCommand.cpp).
Comment 2 Robert Knight 2008-01-30 01:43:55 UTC
> quotes are stripped out for some reason

The arguments are stored as separate strings internally, so the quotes are not necessary.  Plus arguments need to be unquoted when passing them as the command-line to the new process.
Comment 3 Armin Berres 2008-02-07 20:49:27 UTC
Yay, just wanted to report exactly this bug.
I have a profile to open a screen session on a remote host. The command I execute is something like this: "autossh -t foo 'screen -raAd'". Without the ' the call is quite useless.
I edited the .profile file by hand and everything works fine now.
Comment 4 Robert Knight 2008-06-12 04:49:02 UTC
*** Bug 163839 has been marked as a duplicate of this bug. ***
Comment 5 Robert Knight 2008-07-25 17:05:00 UTC
SVN commit 837723 by knight:

Quote arguments containing spaces when expanding the list of arguments
in a ShellCommand.

BUG: 156826
BACKPORT: 4.1


 M  +12 -1     ShellCommand.cpp  


WebSVN link: http://websvn.kde.org/?view=rev&revision=837723