Shell line drawing notes

From Helpful
Jump to navigation Jump to search


Line drawing is done using special characters. Both terminal and the shell itself assume certain behaviour (output and input translation), and may also base this on the terminal type, TERM.


Physical text console:

  • adds the consideration of the font in use, and whether it supports unicode characters (and whether the system setup has limits it from using that) (verify)

Putty:

  • Many newer distros use UTF8 output; try configuring PuTTY to input that (under Window / Translation)
  • PuTTY reports itself as an 'xterm' type terminal. You can make the remote end assume less by making this 'linux' or so (under Connection / Data) (though this means you will get blocks instead of lines).


when something that should look like

┌──────┐
│      │
│      │
├──────┤
│      │
└──────┘

instead looks like...

Diagnosis

+-|

+------+
|      |
|      |
+------+
|      |
+------+

Something intentionally chooses ASCII characters (+. -, and |) to do line drawing, often either because it likes doing it that way, or because it thinks it's the best option in the context.

For example, midnight commander can do so because of configuration, environment (mostly TERM?), or because you used -a or --stickchars.

â (possibly with line width confusion)

ââââââââ
â      â
â      â
ââââââââ
â      â
ââââââââ

This means the remote end outputs UTF8, and your client is set to interpret it as a codepage

Can be one of various codepages (the â is 0xE2(verify), a common first byte in UTF8 sequences for western characters), though typically comes from by defaults, e.g. PuTTY's defaulting to ISO 8859.


Anything that assumes one-byte-per-character drawing will also get very confused about positions and line widths, so things may align badly.


Solution:

  • If your client supports UTF8, tell it that's what it's getting
  • If your client doesn't support UTF8, set your remote end to send whatever encoding your client is limited to

lqxktvmj

This article/section is a stub — some half-sorted notes, not necessarily checked, not necessarily correct. Feel free to ignore, or tell me about it.
lqqqqqqk
x      x
x      x
tqqqqqqv
x      x 
mqqqqqqj

Seems to be caused by incorrect terminfo/termcap information for the given console, related the case where it says it supports VT100-style line drawing, but not actually doing so (or not having it in your font?).(verify) (These characters are the ones within VT100 line drawing escapes, and those escapes are being ignored. VT100 emulation would map them to actual line characters)(verify)

When you know the console/shell/emulator probably supports lines, the simplest solution may be to set a different TERM (xterm?, rxvt?). (verify)