Unix Programming - Ansi escape codes for xterm text buffers?

This is Interesting: Free IT Magazines  
Home > Archive > Unix Programming > September 2007 > Ansi escape codes for xterm text buffers?





You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

Author Ansi escape codes for xterm text buffers?
Boltar

2007-09-20, 7:30 am

Hi

Does anyone know what escape codes to send (or a web page that details
them) which allow the multiple text buffers in some xterms. Eg , using
vim in Linux when you quit it returns to the same screen with all the
history text you had before starting the editor instead of just
scrolling the editor screen up one line and printing a prompt as you
get elsewhere. Anyone know how this is done?

Thanks for any help

B2003

Logan Shaw

2007-09-20, 1:30 pm

Boltar wrote:
> Does anyone know what escape codes to send (or a web page that details
> them) which allow the multiple text buffers in some xterms. Eg , using
> vim in Linux when you quit it returns to the same screen with all the
> history text you had before starting the editor instead of just
> scrolling the editor screen up one line and printing a prompt as you
> get elsewhere. Anyone know how this is done?


Easiest way to find out would be to do something like this:

script foo
vi bar
exit

Then the proper escape codes will have been captured in the file 'foo'.

You can then dump the terminal entry to find out the symbolic name
for that escape code by doing "infocmp $TERM".

I don't know a ton about this particular aspect of Unix programming,
but I'm 99% sure you could just use curses or similar instead and
have it spit out the appropriate codes for you, which would be better
than hard-coding them into your program.

- Logan
Scott Lurndal

2007-09-21, 1:27 pm

Boltar <boltar2003@yahoo.co.uk> writes:
>Hi
>
>Does anyone know what escape codes to send (or a web page that details
>them) which allow the multiple text buffers in some xterms. Eg , using
>vim in Linux when you quit it returns to the same screen with all the
>history text you had before starting the editor instead of just
>scrolling the editor screen up one line and printing a prompt as you
>get elsewhere. Anyone know how this is done?
>
>Thanks for any help
>
>B2003
>


In termcap, the sequences are identified by ti/te. For terminfo,
the sequences are smcup and rmcup.

e.g.

infocmp xterm | grep smcup
infocmp xterm | grep rmcup

scott
Thomas Dickey

2007-09-22, 7:16 pm

Scott Lurndal <scott@slp53.sl.home> wrote:
> Boltar <boltar2003@yahoo.co.uk> writes:
[vbcol=seagreen]
> In termcap, the sequences are identified by ti/te. For terminfo,
> the sequences are smcup and rmcup.


That happens to be true for xterm, but not for terminals in general...

--
Thomas E. Dickey
http://invisible-island.net
ftp://invisible-island.net
Sponsored Links






Free braindumps | Software forum | Database administration forum

Copyright 2003 - 2008 webservertalk.com