[Note: parts of this message were removed to make it a legal post.]
Hi all,
Looking through the PDoc source to see how it renders the build progress
meter, I see:
log "\c[[F\c[[K Rendering: #{dest}"
Is there a good reference for these escape sequences anywhere? They're not
terribly Google-friendly.
--
James Coglan
http://jcoglan.com
|
|
0
|
|
|
|
Reply
|
jcoglan (199)
|
8/6/2009 8:56:53 AM |
|
Hi,
2009/8/6 James Coglan <jcoglan@googlemail.com>:
> Hi all,
>
> Looking through the PDoc source to see how it renders the build progress
> meter, I see:
>
> =C2=A0log "\c[[F\c[[K =C2=A0 =C2=A0Rendering: #{dest}"
>
> Is there a good reference for these escape sequences anywhere? They're no=
t
> terribly Google-friendly.
>
"\c[" is same to "\e"
"\c[[F" is invalid sequence. cf: "\c[[f" means "Move cursor to upper
left corner"
"\c[[K" means "Clear line from cursor right"
Refer to http://ascii-table.com/ansi-escape-sequences-vt-100.php
Regards,
Park Heesob
|
|
0
|
|
|
|
Reply
|
phasis1 (222)
|
8/6/2009 9:33:07 AM
|
|
[Note: parts of this message were removed to make it a legal post.]
2009/8/6 Heesob Park <phasis@gmail.com>
> Hi,
>
> 2009/8/6 James Coglan <jcoglan@googlemail.com>:
> > Hi all,
> >
> > Looking through the PDoc source to see how it renders the build progress
> > meter, I see:
> >
> > log "\c[[F\c[[K Rendering: #{dest}"
> >
> > Is there a good reference for these escape sequences anywhere? They're
> not
> > terribly Google-friendly.
> >
> "\c[" is same to "\e"
> "\c[[F" is invalid sequence. cf: "\c[[f" means "Move cursor to upper
> left corner"
> "\c[[K" means "Clear line from cursor right"
>
> Refer to http://ascii-table.com/ansi-escape-sequences-vt-100.php
Thanks. \e[F is not listed though on my system it seems to have the effect
of returning the cursor to the start of the line, so \e[F\e[K can be used to
overwrite the whole of the current line. Anyone know if this is commonly
implemented or is it Ubuntu-specific?
James
|
|
0
|
|
|
|
Reply
|
jcoglan (199)
|
8/6/2009 9:47:30 AM
|
|
James Coglan <jcoglan@googlemail.com> writes:
> [Note: parts of this message were removed to make it a legal post.]
>
> Hi all,
>
> Looking through the PDoc source to see how it renders the build progress
> meter, I see:
>
> log "\c[[F\c[[K Rendering: #{dest}"
>
> Is there a good reference for these escape sequences anywhere? They're not
> terribly Google-friendly.
Each terminal kind has its own escape sequences. There are thousands
of different kinds of terminals. A subset of their escape sequences
are referenced in the termcap or terminfo files, for use by libraries
such as curses, to provide a certain level of terminal independance on
the application side.
However, nowadays we don't use many physical terminals anymore. We
still use virtual terminals (xterm, Terminal.app, etc). So there is
still diversity, but much less.
There are standardized escape sequences, and most kinds of terminal
actually includes at least a basic subset of these standard escape
sequences. There's the ISO-6429 standard, but you will need money to
get it. There is also the ECMA-048 standard which should be identical
to ISO-6429 and can be downloaded from the web. There's also an ANSI
standard that should be identical or quite similar, but I don't know
the reference. However, these standard escape sequences are often
known by the name ANSI escape sequences (probably because on Microsoft
systems they're implemented by a module stored in a file named
ANSI.SYS).
So to have the highest possible level of terminal compatibility, you
should rather use a curses library (which will select the escape
sequence to send depending on the terminal of the user).
If you choose to use these standard escape sequences, you will
restrict your program to terminals that implement these standard
escape sequences (probably 95% of the (virtual) terminals in use
today, so not a big loss).
But even in this later case, I would advise you to abstract them away.
Instead of writting:
log "\c[[F\c[[K Rendering: #{dest}"
write:
log "#{Ecma048.cpl}${Ecma048.el} Rendering: #{dest}"
(Notice that most of these escape sequences may take optional numeric arguments.
CPL (Cursor Preceding Line) with an argument would could back several lines.)
--
__Pascal Bourguignon__
|
|
0
|
|
|
|
Reply
|
pjb (7644)
|
8/6/2009 9:53:22 AM
|
|
2009/8/6 Heesob Park <phasis@gmail.com>:
> Hi,
>
> 2009/8/6 James Coglan <jcoglan@googlemail.com>:
>> Hi all,
>>
>> Looking through the PDoc source to see how it renders the build progress
>> meter, I see:
>>
>> =C2=A0log "\c[[F\c[[K =C2=A0 =C2=A0Rendering: #{dest}"
>>
>> Is there a good reference for these escape sequences anywhere? They're n=
ot
>> terribly Google-friendly.
>>
> "\c[" is same to "\e"
> "\c[[F" is invalid sequence. cf: "\c[[f" means "Move cursor to upper
> left corner"
> "\c[[K" means "Clear line from cursor right"
>
> Refer to http://ascii-table.com/ansi-escape-sequences-vt-100.php
>
Correction:
"\c[[F" means "Cursor Preceding Line"
"\c[[K" means "Erase in Line"
Refer to http://www.atariarchives.org/cfn/12/02/0075.php
Regards,
Park Heesob
|
|
0
|
|
|
|
Reply
|
phasis1 (222)
|
8/6/2009 10:05:42 AM
|
|
Hi,
Am Donnerstag, 06. Aug 2009, 17:56:53 +0900 schrieb James Coglan:
> Looking through the PDoc source to see how it renders the build progress
> meter, I see:
>
> log "\c[[F\c[[K Rendering: #{dest}"
>
> Is there a good reference for these escape sequences anywhere? They're not
> terribly Google-friendly.
This is the whole truth: <http://www.xfree86.org/current/ctlseqs.html>.
Be aware that there are a lot of terminal programs (xterm, KDE,
Gnome, Xfce4, aterm, wterm, ...) and not everything is implemented
everywhere.
If you like to track what escape sequences some programs write
you can use the script command.
Bertram
--
Bertram Scharpf
Stuttgart, Deutschland/Germany
http://www.bertram-scharpf.de
|
|
0
|
|
|
|
Reply
|
lists2051 (431)
|
8/6/2009 10:17:24 AM
|
|
Heesob Park <phasis@gmail.com> writes:
> Hi,
>
> 2009/8/6 James Coglan <jcoglan@googlemail.com>:
>> Hi all,
>>
>> Looking through the PDoc source to see how it renders the build progress
>> meter, I see:
>>
>> �log "\c[[F\c[[K � �Rendering: #{dest}"
>>
>> Is there a good reference for these escape sequences anywhere? They're not
>> terribly Google-friendly.
>>
> "\c[" is same to "\e"
> "\c[[F" is invalid sequence. cf: "\c[[f" means "Move cursor to upper
> left corner"
ESC [ <Pn> F is CPL, Cursor Preceding Line, in ECMA-048.
> "\c[[K" means "Clear line from cursor right"
>
> Refer to http://ascii-table.com/ansi-escape-sequences-vt-100.php
Which would only prove that the VT-100 terminals don't implement ECMA-048.
--
__Pascal Bourguignon__
|
|
0
|
|
|
|
Reply
|
pjb (7644)
|
8/6/2009 11:20:25 AM
|
|
|
6 Replies
30 Views
(page loaded in 0.168 seconds)
Similiar Articles: ANSI terminal escape sequence regexp - comp.unix.shellI am looking for a regexp that matches the ANSI terminal escape sequences (ESC [ ...) (for xterm), or alternatively for a tool (Linux) that replaces ... ncurses - convert to esc-sequence - comp.unix.programmer ...ANSI 256 characters and codes, how to - comp.lang.awk ANSI terminal escape sequence regexp - comp.unix.shell... done that, but I suppose any ... on ANSI 256 characters and ... Video Test Sequences - comp.compressionHi, Where can I download the video test sequences like Akiyo, Foreman, CoastGuard ... WordStar or CP/M patches for VT100 terminal - comp.os.cpm ..... soldered MASK ROMs ... Bash Shell escapes not working via Putty ssh? - comp.unix.shell ...Most terminal programs can > emulate some reasonable subset of vt100 escape sequences or ANSI codes, > but, many either don't implement color, or don't enable it by ... how do i reset the terminal - comp.unix.solarisANSI terminal escape sequence regexp - comp.unix.shell how do i reset the terminal - comp.unix.solaris ANSI terminal escape sequence regexp - comp.unix.shell how do i ... WordStar or CP/M patches for VT100 terminal - comp.os.cpm ...But when any further commands are > entered, parts of strings, that should be VT100 escape sequences for > terminal control functions, start appearing on the screen as ... find sequences of 1's - comp.soft-sys.matlabANSI terminal escape sequence regexp - comp.unix.shell I am looking for a regexp that matches the ANSI terminal escape sequences (ESC [ ...) (for xterm), or alternatively ... how to clear screen in unix - fn. similar to clrscr() in DOS ...ANSI terminal escape sequence regexp - comp.unix.shell how to clear screen in unix - fn. similar to clrscr() in DOS ... ANSI terminal escape sequence regexp - comp.unix ... Mapping home and end keys - ksh and Putty - comp.unix.shell ...Test regex in KSH - comp.unix.shell Mapping home and end keys - ksh and Putty - comp.unix.shell ... ANSI terminal escape sequence regexp - comp.unix.shell All the ... Recording X-10 PLC sequences - comp.home.automation... function and regexp - comp.lang.awk Here is an example: % gawk 'function foo(x ... lang.awk Trying to use a regular expression for record ... ANSI terminal escape sequence ... ANSI escape code - Wikipedia, the free encyclopediaANSI escape sequences are characters embedded in the text used to control formatting, color, and other output options on video text terminals. Almost all terminal ... ANSI/VT100 Terminal Control Escape SequencesANSI Terminal Escape Codes. ... Many computer terminals and terminal emulators support colour and cursor control through a system of escape sequences. 7/28/2012 12:16:00 AM
|