On Wednesday 25 April 2007, Randall R Schulz said:
> On Wednesday 25 April 2007 14:26, Randall R Schulz wrote:
> > ...
> >
> > Furthermore, the answer to the primary question from the OP is given
> > there directly, making those of us who claimed it wasn't possible
> > flat wrong:
> >
> > #!/bin/sh
> > konsole=$(dcopstart konsole-script)
> > session=$(dcop $konsole konsole currentSession)
> > dcop $konsole $session renameSession Local
> >
> > session=$(dcop $konsole konsole newSession)
> > dcop $konsole $session renameSession Remote
> >
> > # Send a command to a Konsole session (tab)
> > session=$(dcop $konsole konsole newSession)
> > dcop $konsole $session renameSession Code
> > dcop $konsole $session sendSession 'cd /my/work/directory'
>
> Sadly, the "sendSession" function appears to be a figment of the mind of
> the writer of that page. In fact, just above this example is a listing,
> produced by dcop itself, of the functions available, and sendSession is
> nowhere in evidence.
>
> And in fact, on my 10.0 system, the sample code does not work:
>
> % dcop konsole-7761 session-5 "sendSession 'dl'"
> no such function

sendSession was removed from the default dcop interface as it's a security 
risk.  You can turn it back on by starting konsole with --script.  That gets 
you feedSession and sendSession.  feedSession just sends the text to the 
console, sendSession does the same and presses return immediately afterwards.

Start a new konsole, open a new session within it and make that echo hello 
world:

konsole --script& 
konsoleinstance=konsole-$!
session=$(dcop $konsoleinstance default newSession)
dcop $konsoleinstance $session sendSession "echo hello world\!"

HTH

Will
-- 
Desktop Engineer
Interfaces and Applications Team
-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to