Browse Source

fancy-prompt.lua: workaround a Readline UTF-8 bug

Přemysl Janouch 5 months ago
parent
commit
94b0ec80cf
No known key found for this signature in database
1 changed files with 4 additions and 0 deletions
  1. 4
    0
      plugins/degesch/fancy-prompt.lua

+ 4
- 0
plugins/degesch/fancy-prompt.lua View File

@@ -64,6 +64,10 @@ degesch.hook_prompt (function (hook)
64 64
 	local lines, cols = degesch.get_screen_size ()
65 65
 	x = x .. " " .. active .. string.rep (" ", cols)
66 66
 
67
+	-- Readline seems to be broken and completely corrupts the prompt
68
+	-- (tested on 7.0.003 Archlinux, 7.0-5 Debian buster)
69
+	x = x:gsub("[\128-\255]", "?")
70
+
67 71
 	-- Cut off extra characters and apply formatting, including the hack.
68 72
 	-- Note that this doesn't count with full-width or zero-width characters.
69 73
 	local overflow = utf8.offset (x, cols - 1)

Loading…
Cancel
Save