ynqa / jnv

Interactive JSON filter using jq
MIT License
4.83k stars 52 forks source link

blinking when using xterm -cm #17

Open rjpcasalino opened 6 months ago

rjpcasalino commented 6 months ago

when I enter xterm -cm and get a terminal without color (from what I understand of what the -cm flags are doing) I see blinking during tab completion. I wonder why? Sorry my video is a bit zoomed strangely but will show you what I see. Cool tool and many thanks. My terminal colors are strange anyway so this isn't a big deal but wanted to report it and see if there is an easy fix.

https://github.com/ynqa/jnv/assets/12821230/23bd09ce-7970-46ae-86ea-f610cce9f83c

ynqa commented 6 months ago

@rjpcasalino I'm not very familiar with xterm, so please enlighten me.

rjpcasalino commented 6 months ago
* Does `-cm` option refer to what's commonly known as the no-color option?

-cm disables recognition of ANSI color-change escape sequences.

  • Did you use -cm option because the default color of jnv is hard to see on your terminal? Yes, it would be handy to have a no color option.
  • If -cm option is not used, does it display correctly? Yep!
ynqa commented 6 months ago

@rjpcasalino Honestly, the flickering phenomenon could be occurring at xterm or crossterm layer, and I'm not sure if it can be fixed.

On the other hands, if the issue is that the current colors are hard to see, I am planning to create a mechanism in #23 that allows users to set their own color themes. Could this mechanism be used to circumvent the problem?

rjpcasalino commented 6 months ago

@ynqa yes, having a mechanism to set custom themes would be great. I think a nice default option to consider is allowing no colors. Where in the code do colors get set now?-for one curious enough to go peek? Many thanks for this and taking the time to address this issue :)