[darcs-users] Re: Can I disable \xx quoting in record --interactive?

Tommy Pettersson ptp at lysator.liu.se
Mon Mar 21 14:52:32 UTC 2005

On Mon, Mar 21, 2005 at 08:30:54PM +1100, Nigel Rowe wrote:
> I think you will also need to \xx quote bytes in the range
> 0x80-0x9f as well.  For example on ansi/VTxxx style terminals (eg. linux 
> console, xterm etc) 0x9b (ESC with bit 8 set) is treated as '0x1b[', ie one 
> of the escape code lead-ins.  Eg either 0x1b[2J or 0x9b2J will clear screen.
> I'm unsure what other hi-bit control codes may be used.

The problem seems to be that different terminals do different
things with control chars, and it also depends on the current
locale and other settings.  So to see chars of a special
encoding in one environment, you'll have to let through control
chars that could spoof the terminal in another environment.

To be absolutely paranoid darcs can't assume anything about
what will happen with the octets it sends to the terminal,

The best long term solution I can think of is to have darcs
always generate 7-bit ASCII or (optionally) UTF8 for output,
and have an optional filter hook that the user can select
to get whatever darcs is outputting converted from UTF8 to
something safe and readable in non-utf8 environments.

The best short term work around I can think of is to have a
DARCS_ESCAPE_LEVEL environment variable that increases the
set of octets that darcs will not escape, so users can select
a good compromise that shows as many glyphs as possible but
escapes as many controls as possible.

I have already implemented this latter idea, only with two
extra levels so far, of which one works for UTF8.

Tommy Pettersson <ptp at lysator.liu.se>

More information about the darcs-users mailing list