pmenu
pmenu copied to clipboard
colorize pmenu
Would it be possible to implement an option to colorize the menu? So that for example ls --color | pmenu would be rendered in color. Or alternatively maybe an option to colorize the menu with grc and grcat could be implemented?
The colorcodes from ls --color are passed to the input_items: print(input_items)
after the input_items assignment returns colored output. However the function: result = redirect_stdio(lambda: curses_wrapper(main))
somehow results in colorless output
Hi @dalanicolai! I've looked into whether it's possible to bypass some pre-existing escape sequences (like colors) to curses
in python
, but looks like there's no easy way to output test with them in curses
. For instance: https://stackoverflow.com/questions/27464023/how-to-use-ansi-escape-codes-inside-mvwprintw-in-ncurses/27475218#27475218. If I understand it right, for that we need to parse escape sequences out and then emulate their effects using primitives and attributes from curses
. It makes this solution not portable and error-prone.
Maybe there're some alternatives but I'm not sure. Judging by this issue fzf
supports it with --ansi
option. PathPicker maybe, too.