I want to be able to get a script (ran at startup) to open up a konsole
terminal.
When it opens it is to do some persistent things (like change directory and source bashrc) and run a long running program.
If the program crashes or I come in and <ctrl+c>
it, it is to start accepting commands from standard input (like 'up-enter' to try again, as if it was interactive the whole time).
I have tried so many things to get it working (I'm currently just trying to get it to ls
and revert to interactive on completion);
konsole -e ls
konsole --hold ls
konsole -e /bin/bash -c ls
konsole --hold -e "/bin/bash -c ls"
konsole -e "/bin/bash -i -c ls"
konsole -e /bin/bash -i -c ls
konsole -e "echo ls > /tmp/konsolebash;/bin/bash -i --rcfile /tmp/konsolebash"
echo ls > /tmp/konsolebash
konsole -e "/bin/bash -i --rcfile /tmp/konsolebash"
Is it to do with the quotes? Should I not be using them, should I be escaping something?
Am I even meant to try and execute bash
?
I'm running out of ideas but I hope it's even achievable (but hopefully not something embarrassingly simple that I missed).
I'll upvote answers that successfully use other terminal emulators if konsole
in particular is the problem (but since the question is specifically about konsole
I don't think I can give you the juicy tick)
source ... ls
?--rcfile
should have done exactly what you need... Edit: In fact, I just checked andbash --rcfile /tmp/foo
does work for me, whilebash
refuses to start with-i --rcfile /tmp/foo
. So try omitting the-i
and see if that helps.