fancy-prompt.lua: workaround a Readline UTF-8 bug
This commit is contained in:
parent
300f9a9708
commit
94b0ec80cf
|
@ -64,6 +64,10 @@ degesch.hook_prompt (function (hook)
|
||||||
local lines, cols = degesch.get_screen_size ()
|
local lines, cols = degesch.get_screen_size ()
|
||||||
x = x .. " " .. active .. string.rep (" ", cols)
|
x = x .. " " .. active .. string.rep (" ", cols)
|
||||||
|
|
||||||
|
-- Readline seems to be broken and completely corrupts the prompt
|
||||||
|
-- (tested on 7.0.003 Archlinux, 7.0-5 Debian buster)
|
||||||
|
x = x:gsub("[\128-\255]", "?")
|
||||||
|
|
||||||
-- Cut off extra characters and apply formatting, including the hack.
|
-- Cut off extra characters and apply formatting, including the hack.
|
||||||
-- Note that this doesn't count with full-width or zero-width characters.
|
-- Note that this doesn't count with full-width or zero-width characters.
|
||||||
local overflow = utf8.offset (x, cols - 1)
|
local overflow = utf8.offset (x, cols - 1)
|
||||||
|
|
Loading…
Reference in New Issue