superfile
superfile copied to clipboard
Double ANSI escape not rendering correctly in some terminals (kitty)
Describe the bug
String manipulation for menus sometimes produces 2 \x1b
next to each other. Some terminals break
To Reproduce
I was able to debug by adding a hack here before the return: https://github.com/yorukot/superfile/blob/cc50cd630404d4d7e23e325af87e978cc3548129/src/pkg/string_function/overplace.go#L100-L113
output := b.String()
os.WriteFile("/tmp/temp.out", []byte(output), 0666)
return output
//return b.String()
Steps to reproduce the behavior: 0. Build with the above hack
- Open "Sort Options"
- Close Program
- Open the dumped output in a hex editor, Search for the byte sequence
1B 1B
Expected behavior
No occurrence of the byte sequence 1B 1B
Screenshots
I have not figured out how to screenshot on my system (sorry), but basically, kitty does not like the double \x1b
, and renders something like:
Sort Options [0m|
System information (please complete the following information):
- OS: Arch Linux 6.11.6-arch1-1
- Superfile Version 1.1.5