Hello,

Darn, I wished it was easier. I managed to get a 'dumb' Karaf Dhell up
and running by passing a org.apache.karaf.shell.ssh.ShellFactoryImpl
to the server [1], [2].
Like you said, I should delegate all commands except for the ones that
on the 'Fake List' which will be treated separately.

But I still wonder if I could delegate command completion to the
native shell somehow, maybe in the background. I mean, command
completion is done when the user sends some text followed by two TAB
characters. At that point the shell responds with some text. I guess
I'll use a native interactive shell and run some experiments.

Wish me luck and ping me if you get some ideas.

Cheers,

[1] 
https://github.com/apache/karaf/blob/trunk/shell/ssh/src/main/resources/OSGI-INF/blueprint/shell-ssh.xml
[2] 
https://github.com/apache/karaf/blob/trunk/shell/console/src/test/java/org/apache/karaf/shell/console/ExampleSubclassMain.java


On Thu, Jan 24, 2013 at 1:11 PM, Guillaume Nodet <[email protected]> wrote:
> If I understand you correcly, you're trying to launch a native shell, but
> have some kind of pre-processing of commands in java.
> The problem is that there's no way afaik to get back from the native shell
> to the sshd environement.
> I guess you could customize your native shell to some point to do some of
> the processing in scripts, like creating bash functions that will act as
> proxy to the native commands and do your ignore/execute logic there.
> Else, I'd really suggest using jline as the shell and implement jline
> commands that would then delegate to native commands.
>
>
>
> On Thu, Jan 24, 2013 at 11:37 AM, Ioan Eugen Stan 
> <[email protected]>wrote:
>
>> Hello Guillaume,
>>
>> Thank you for your quick response and the pointers. I know SSHD does
>> not aim at providing an interactive shell, but I'm not planning to
>> re-implement it myself also. Is it possible for example to delegate
>> all characters to the native shell and on new-line to decide one of
>> the two:
>>
>> - if the command entered so far is not to be executed then drop it
>> silently and return fake output to the user
>> - if the command should be executed - forward the newline to the
>> native, interactive shell
>>
>> This should avoid the need for re-implementing the commands and
>> command completers and leverage the native shells command completing
>> capabilities. Is this ok?
>>
>> By the way, you did incredible work on SSHD and jline.
>>
>> Cheers,
>>
>> --
>> Ioan Eugen Stan / CTO / http://axemblr.com
>>
>
>
>
> --
> ------------------------
> Guillaume Nodet
> ------------------------
> Blog: http://gnodet.blogspot.com/
> ------------------------
> FuseSource, Integration everywhere
> http://fusesource.com



-- 
Ioan Eugen Stan / CTO / http://axemblr.com

Reply via email to