Skip to content
David B. Lamkins edited this page Dec 14, 2020 · 1 revision

XS Q&A

Readline

How do I get my favorite readline(3) setting?

Create or edit a ~/.inputrc file. See $ info readline; search for "Readline Init File".

How do I bind readline(3) commands specifically for use by xs?

Put them in a $if xs ... $endif block in your ~/.inputrc file. For example:

$if xs
C-g: " >[2=1]|less -FX"
$endif

Prompt

I'm using a prompt which contains UTF-8 multibyte characters; the input gets garbled when I attempt to edit. How do I fix this?

This happens when xs is not running in a UTF-8 locale. Set a UTF-8 locale in your ~/.xsrc file:

LC_ALL = en_US.UTF-8
LANG = $LC_ALL

How do I set a color or style for my prompt?

Use ANSI escape sequences. Xs knows how to hide escape sequences and control characters from readline(3).