pmenu icon indicating copy to clipboard operation
pmenu copied to clipboard

colorize pmenu

Open dalanicolai opened this issue 5 years ago • 2 comments

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

dalanicolai avatar Mar 16 '19 18:03 dalanicolai

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.

sgtpep avatar Mar 18 '19 21:03 sgtpep

Maybe there're some alternatives but I'm not sure. Judging by this issue fzf supports it with --ansi option. PathPicker maybe, too.

sgtpep avatar Mar 18 '19 21:03 sgtpep