Changes between Version 3 and Version 4 of ControlSequencesInPrompt
- Timestamp:
- 09/13/10 21:25:59 (3 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
ControlSequencesInPrompt
v3 v4 1 1 = Escape Sequences in the Prompt String = 2 2 3 As of version 0.6.3 (#78), Haskeline will compute the correct width for input prompts that contain POSIX escape sequences such as color changes. However, the ending must be indicated in the prompt string, since there's no way for Haskeline to detect it automatically.3 As of version 0.6.3 (#78), Haskeline will compute the correct width for input prompts that contain POSIX escape sequences such as color changes. However, the prompt string must indicate the end of each escape sequence, since there's no way for Haskeline to detect it automatically. 4 4 5 The end ingis denoted by the control character {{{'\STX'}}} (i.e., ASCII {{{'\002'}}}). Any substring in the prompt of the form {{{"\ESC...\STX"}}} will be treated as zero-width for the purposes of line-breaking.5 The end is denoted by the control character {{{'\STX'}}} (i.e., ASCII {{{'\002'}}}). Any substring in the prompt of the form {{{"\ESC...\STX"}}} will be treated as zero-width for the purposes of line-breaking. 6 6 7 7 On Windows, escape sequences of the form "\ESC...\STX" will be ignored. … … 16 16 If GHC (or the ghci-haskeline package) has been compiled against haskeline-0.6.3 or newer, adding the following line to your `~/.ghci` file will turn the prompt string green: 17 17 {{{ 18 :set prompt "\ SOH\ESC[1;32m\STX%s>\SOH\ESC[0m\STX"18 :set prompt "\ESC[1;32m\STX%s>\ESC[0m\STX" 19 19 }}} 20 20
