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: Peter Stuge <peter_at_stuge.se>
Date: Mon, 30 Mar 2015 13:59:21 +0200

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:
>
> rompt> u
> rompt>
> rompt> u
> rompt>
> rompt> us
> rompt>
> rompt> 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
Received on 2015-03-30

the libssh2 team