Thanks for your reply,
this is my code:

    Channel channel=session.openChannel("shell");

      // a hack for MS-DOS prompt on Windows.
      channel.setInputStream(new FilterInputStream(System.in){
          public int read(byte[] b, int off, int len)throws IOException{
            return in.read(b, off, (len>1024?1024:len));
          }
        });
        channel.setOutputStream(System.out);
using  ((ChannelShell)channel).setPty(false); I don't see any  terminal's
character... in the other case:

Last login: Tue Apr  3 17:06:10 2012 from app-server.test.it

app-server-test:~ # 

so this make me think in an encoding problem...










2012/4/3 Atsuhiko Yamanaka <y...@jcraft.com>

> Hi,
>
>   +-From: gabriele mannocci <gabrielemanno...@gmail.com> --
>   |_Date: Tue, 3 Apr 2012 16:04:56 +0200 __________________
>    |
>   |- I'm using shell channel in a web application and i see a character
>   |encoding problem. The same problem doesn't appear with exec channel:
>    |=1B[1mapp-server:~ # =1B[m=0F. I've try to set file.encoding property
>    |but without success.
>   |  How can I resolve?
>
> They must be escape sequences for the terminal emulator.
> If you want to stop them, you can use ChenelShell#setPty(false) method,
>
>      ...
>      Channel channel=session.openChannel("shell");
>      ((ChannelShell)channel).setPty(false);
>      ...
>
>   |-  is there any way to implement less command in shell?
>
> It is not so clear what you want,  but you will need to interpret
> escape sequences generated from "less" command by yourself.
>
>
> Sincerely,
> --
> Atsuhiko Yamanaka
> JCraft,Inc.
> 1-14-20 HONCHO AOBA-KU,
> SENDAI, MIYAGI 980-0014 Japan.
> Tel +81-22-723-2150
> Skype callto://jcraft/
> Twitter: http://twitter.com/ymnk
> Facebook: http://facebook.com/aymnk
>



-- 
Il verme, calpestato, si rattrappisce. E questo è intelligente. Diminuisce
così la possibilità di venir calpestato nuovamente. Nel linguaggio della
morale: umiltà. (F.Nietzsche)
------------------------------------------------------------------------------
Better than sec? Nothing is better than sec when it comes to
monitoring Big Data applications. Try Boundary one-second 
resolution app monitoring today. Free.
http://p.sf.net/sfu/Boundary-dev2dev
_______________________________________________
JSch-users mailing list
JSch-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jsch-users

Reply via email to