old-www/HOWTO/Bash-Prompt-HOWTO/x622.html

196 lines
3.3 KiB
HTML

<HTML
><HEAD
><TITLE
>Line Draw Characters without VGA Fonts</TITLE
><META
NAME="GENERATOR"
CONTENT="Modular DocBook HTML Stylesheet Version 1.7"><LINK
REL="HOME"
TITLE="Bash Prompt HOWTO"
HREF="index.html"><LINK
REL="UP"
TITLE="The Bash Prompt Package"
HREF="the-bash-prompt-package.html"><LINK
REL="PREVIOUS"
TITLE="Changing the Xterm Font"
HREF="x606.html"><LINK
REL="NEXT"
TITLE="Loading a Different Prompt"
HREF="c641.html"></HEAD
><BODY
CLASS="SECT1"
BGCOLOR="#FFFFFF"
TEXT="#000000"
LINK="#0000FF"
VLINK="#840084"
ALINK="#0000FF"
><DIV
CLASS="NAVHEADER"
><TABLE
SUMMARY="Header navigation table"
WIDTH="100%"
BORDER="0"
CELLPADDING="0"
CELLSPACING="0"
><TR
><TH
COLSPAN="3"
ALIGN="center"
>Bash Prompt HOWTO: </TH
></TR
><TR
><TD
WIDTH="10%"
ALIGN="left"
VALIGN="bottom"
><A
HREF="x606.html"
ACCESSKEY="P"
>Prev</A
></TD
><TD
WIDTH="80%"
ALIGN="center"
VALIGN="bottom"
>Chapter 8. The Bash Prompt Package</TD
><TD
WIDTH="10%"
ALIGN="right"
VALIGN="bottom"
><A
HREF="c641.html"
ACCESSKEY="N"
>Next</A
></TD
></TR
></TABLE
><HR
ALIGN="LEFT"
WIDTH="100%"></DIV
><DIV
CLASS="SECT1"
><H1
CLASS="SECT1"
><A
NAME="AEN622"
></A
>8.4. Line Draw Characters without VGA Fonts</H1
><P
>Xterm and rxvt can be switched into line-draw mode on the fly with the
appropriate escape sequence. You'll need to switch back after you've
output the characters you wanted or any text following it will be garbled.
Prompts based on these output codes don't work on the console, instead
producing the text equivalents.&#13;</P
><P
>To start a sequence of line draw characters, use an <B
CLASS="COMMAND"
>echo
-e</B
> and the <B
CLASS="COMMAND"
>\033(0</B
> escape sequence. Most of
the characters worth using are in the range lower case "a" through "z".
Terminate the string with another escape sequence,
<B
CLASS="COMMAND"
>\033(B</B
> .&#13;</P
><P
>The best method I've found for testing this is shown in the image below:
use the <B
CLASS="COMMAND"
>escgen</B
> script mentioned earlier in the HOWTO to
show the 100 to 200 octal range, <B
CLASS="COMMAND"
>echo</B
> the first escape
sequence, run the <B
CLASS="COMMAND"
>escgen</B
> script for the same range, and
<B
CLASS="COMMAND"
>echo</B
> the closing escape sequence. The image also shows
how to use this in a prompt.&#13;</P
><DIV
CLASS="MEDIAOBJECT"
><P
><IMG
SRC="images/rxvt-line-draw.jpg"><DIV
CLASS="CAPTION"
><P
>Using escape sequences in RXVT (also works in Xterm and RXVT derivatives
like aterm, which is used here) to produce line draw characters. The
"escgen" script used above is given earlier in the HOWTO.&#13;</P
></DIV
></P
></DIV
></DIV
><DIV
CLASS="NAVFOOTER"
><HR
ALIGN="LEFT"
WIDTH="100%"><TABLE
SUMMARY="Footer navigation table"
WIDTH="100%"
BORDER="0"
CELLPADDING="0"
CELLSPACING="0"
><TR
><TD
WIDTH="33%"
ALIGN="left"
VALIGN="top"
><A
HREF="x606.html"
ACCESSKEY="P"
>Prev</A
></TD
><TD
WIDTH="34%"
ALIGN="center"
VALIGN="top"
><A
HREF="index.html"
ACCESSKEY="H"
>Home</A
></TD
><TD
WIDTH="33%"
ALIGN="right"
VALIGN="top"
><A
HREF="c641.html"
ACCESSKEY="N"
>Next</A
></TD
></TR
><TR
><TD
WIDTH="33%"
ALIGN="left"
VALIGN="top"
>Changing the Xterm Font</TD
><TD
WIDTH="34%"
ALIGN="center"
VALIGN="top"
><A
HREF="the-bash-prompt-package.html"
ACCESSKEY="U"
>Up</A
></TD
><TD
WIDTH="33%"
ALIGN="right"
VALIGN="top"
>Loading a Different Prompt</TD
></TR
></TABLE
></DIV
></BODY
></HTML
>