Bug 308795

Summary: Make konsole support -e "ls -lsa | grep libavcodec", like xterm does
Product: [Applications] konsole Reporter: bbutscheidt
Component: generalAssignee: Konsole Developer <konsole-devel>
Status: CONFIRMED ---    
Severity: wishlist CC: cpigat242, juancarlospaco
Priority: NOR    
Version: 2.9.2   
Target Milestone: ---   
Platform: Gentoo Packages   
OS: Linux   
Latest Commit: Version Fixed In:
Sentry Crash Report:

Description bbutscheidt 2012-10-22 09:08:32 UTC
When I do this:
xterm -hold -e "ls -lsa | grep libavcodec"

I get an xterm-Terminal showing:
156 drwxr-xr-x 11 bernd_b bernd_b    16384 Oct  3 16:52 libavcodec

So far, so boring. When I try the same with konsole from the same starting point (always a konsole Terminal intself) doing:
konsole --noclose -e "ls -lsa | grep libavcodec"

I get a listing of the whole directory. So "|" ist ignored by the -e commandline option?

Reproducible: Always

Steps to Reproduce:
1.Just shoot the examples given again from a konsole.
2.
3.


Expected Results:  
I would expect the same behaviour as xterm shows (executing the whole -e agument).
Comment 1 Kurt Hindenburg 2012-10-27 02:49:58 UTC
Yes you're correct - konsole pulls the first arg as the program and the rest as args
Comment 2 Jekyll Wu 2012-10-27 05:44:54 UTC
The more underlying problem is konsole currently disagrees with xterm on what a valid command is .

xterm supports  this, while konsole simple does not: 
 
    $ xterm -hold -e "cd /tmp; ls -la" 

Is "cd /tmp; ls -la" a valid command, from the point of view of a *terminal emulator* ?  "cd", ";" and "|" are all things only supported and understood by shells.  Terminal emulators are not shells, so the only sensible way to "support" that kind of command is pass it to the system() call , effectively calling ' sh -c "cd /tmp; ls -la"  '.

I guess xterm uses system() as the last resort, but konsole currently simply does not care about that kind of (invalid) "command".
Comment 3 Christoph Feck 2013-04-30 02:28:08 UTC
*** Bug 319095 has been marked as a duplicate of this bug. ***