Originally posted by jlittle
View Post
Announcement
Collapse
No announcement yet.
Konsole command -e How to get to the Dollar prompt
Collapse
This topic is closed.
X
X
-
No. For efficiency with multiple konsole windows it is supposed to run with one instance managing all the windows, and with --nofork you get an independent process. (I say "supposed" because without --nofork I still get lots of processes.) There's still a new shell running in each window. Shells achieve efficiency for lots of them in other ways, though some are better at it than others; IME multiple zsh instances are slower than multiple bash ones (only relevant if you start many of them, dozens or hundreds, like some people do tabs in a browser).Originally posted by shag00 View PostAs an aside, the --separate option, the console reference book https://docs.kde.org/trunk5/en/appli...e-options.html states:
--separate, --noforkRun the new instance of Konsole in a separate process.
Should this be interpreted as running the process in a new shell?
- Top
- Bottom
Leave a comment:
-
@jlittle, thank you very much for your reply. The "ls" example I gave is just for simplicity, getting the dollar prompt was the important thing. What I am doing is creating a desktop launcher for a CLI only windows program I need to run with wine. Just running a 1 liner from the launcher I find to be preferable to creating a script so I went with:
which puts me in a new window at the z: prompt.Code:Exec=konsole --separate --hold --workdir ~/.wine -e bash -c "WINEPREFIX=~/.wine/eac3to wine cmd"
Another application is to use a script with K-shutdown that displays the the command to cancel it in a new window, ready to go. Good for when I am half asleep and watching the news.
As an aside, the --separate option, the console reference book https://docs.kde.org/trunk5/en/appli...e-options.html states:
--separate, --noforkRun the new instance of Konsole in a separate process.
Should this be interpreted as running the process in a new shell?
- Top
- Bottom
Leave a comment:
-
konsole -e runs a command instead of a shell (which gives the prompt). So the -e has to run ls and a shell. One way to do this would beI'm scratching my head as to why you'd want to do that.Code:konsole --separate --hold --workdir / -e "$SHELL -c 'ls;$SHELL'"
Better maybe, to get away from the tricky quoting issues, and make it more flexible, would be to make a script, called, say, lssh, with
chmod +x lssh and put it somewhere in your $PATH, then use -e lsshCode:#!/bin/bash ls exec $SHELL
- Top
- Bottom
Leave a comment:
-
Konsole command -e How to get to the Dollar prompt
Kubuntu 18.04.01.
If I enter:
Code:
I get a new Konsole window with the cursor positioned to the right of the Dollar prompt, as expected at the root directory.Code:konsole --separate --hold --workdir /
If I type this command:
Code:
it gives the expected output but no Dollar prompt.Code:konsole --separate --hold --workdir / -e ls
So my question is how to modify the 2nd command to produce the output and then present the Dollar prompt.Tags: None
- Top
- Bottom
Users Viewing This Topic
Collapse
There are 0 users viewing this topic.
Leave a comment: