www.libssh2.org | Daily snapshots | Mailing list archive | Docs | Examples | github

Archive Index This month's Index

Subject: Re: repeated colored prompts

Re: repeated colored prompts

From: meneldor <meneldor_at_gmail.com>
Date: Mon, 30 Mar 2015 15:13:01 +0300

Thank you, Peter. I will search for any info about it. If anyone could
point me to any tutorial/howto i will appreciate it.

On Mon, Mar 30, 2015 at 2:59 PM, Peter Stuge <peter_at_stuge.se> wrote:

> meneldor wrote:
> > Im not implementing terminal emulator. Just need to parse the prompt when
> > any command finishes.
>
> To do that you must implement a proper terminal emulator.
>
>
> > The things are getting ugly if i open python script which uses python's
> > "cmd" lib for custom interactive prompt. So i open that script which
> > "should" print the prompt "prompt> ". Then i send "use test\n". The
> prompt
> > is colored. Here is the result:
> >
> > [0;36prompt> [0m u
> > [0;36prompt> [0m
> > [0;36prompt> [0m u
> > [0;36prompt> [0m
> > [0;36prompt> [0m us
> > [0;36prompt> [0m
> > [0;36prompt> [0m us
> ..
> > I have no idea why i receive so many prompts :)
>
> Because of how the terminal behaves.
>
>
> > i guessed that there is something wrong with the calculations of
> > the screen/pty size/columns because of the un-printable color codes.
>
> No, what is wrong is that you are not correctly implementing a
> terminal emulator. You must do that.
>
>
> //Peter
>
> _______________________________________________
> libssh2-devel http://cool.haxx.se/cgi-bin/mailman/listinfo/libssh2-devel
>

_______________________________________________
libssh2-devel http://cool.haxx.se/cgi-bin/mailman/listinfo/libssh2-devel
Received on 2015-03-30

the libssh2 team