Bug 308795 - Make konsole support -e "ls -lsa | grep libavcodec", like xterm does
Summary: Make konsole support -e "ls -lsa | grep libavcodec", like xterm does
Status: CONFIRMED
Alias: None
Product: konsole
Classification: Applications
Component: general (show other bugs)
Version: 2.9.2
Platform: Gentoo Packages Linux
: NOR wishlist
Target Milestone: ---
Assignee: Konsole Developer
URL:
Keywords:
: 319095 (view as bug list)
Depends on:
Blocks:
 
Reported: 2012-10-22 09:08 UTC by bbutscheidt
Modified: 2016-04-09 14:51 UTC (History)
2 users (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
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. ***