From: kaiquekandykoga Date: 2022-09-18T17:29:24+00:00 Subject: [ruby-core:109951] [Ruby master Bug#19010] Follow up of #18996: Support changing irb's autocompletion background Issue #19010 has been updated by kaiquekandykoga (Ka��que Koga). File Screenshot_20220918_135231.png added I like the idea of having multiple themes. I use light screen for everything, and I enjoy the way irb is currently displayed. Perhaps keeping the current irb's colors as one alternative, and add the proposed light theme and dark theme too. Some people use other colors than black or white for terminals, like blue for instance, so having a few themes thinking about that can help. About the default color. I like to use autocompletion, but I know that some people dislike having enabled autocompletion by default. So if irb start showing the autocompletion only if a theme is set, there is not need to think about a default color. ---------------------------------------- Bug #19010: Follow up of #18996: Support changing irb's autocompletion background https://bugs.ruby-lang.org/issues/19010#change-99199 * Author: st0012 (Stan Lo) * Status: Open * Priority: Normal * Backport: 2.7: UNKNOWN, 3.0: UNKNOWN, 3.1: UNKNOWN ---------------------------------------- If the APIs proposed in #18996 (or similar ones) are accepted, we'll be able to configure `irb`'s autocompletion dialog colors. And for the `irb` side, I want to propose 2 levels of configurations: ### 1. Theme selection Consider most users don't care about individual colors if the text are readable and roughly match with the terminal background, I want to provide 2 basic themes (dark/light) for users to choose: **Theme`:dark`** Light terminal - dark theme Dark terminal - dark theme **Theme `:light`** Light terminal - light theme Dark terminal - light theme **Default** In terms of default, I think `dark` is better than `light`. Because when in a light terminal, seeing a dark dropdown isn't so troubling. But when in a dark terminal, seeing a large light dropdown can bring discomfort to eyes. Side note: It's possible to detect the terminal's background color from an xterm-compatible terminal emulator ([example gist](https://gist.github.com/blueyed/c8470c2aad3381c33ea3)), so `irb` may automatically assign themes based on users' terminal theme. But we still need to pick a default as the fallback. **Interface for theme selection** If we think it's possible to introduce more themes than just dark/light, we can expose the API as ```rb IRB.conf[:DIALOG_THEME] = theme_name ``` If we don't consider introducing other themes, we can make it a toggle for the non-default theme, like ```rb IRB.conf[:USE_LIGHT_THEME] = true ``` ### 2. Per-color configurations For users who want to configure individual colors, we should also provide options on the `irb` side, like ```rb IRB.conf[:dialog_default_bg_color] = :black ``` This prevents directly exposing `reline`'s API to normal `irb` users. **I implemented the ideas in this [proof of concept PR](https://github.com/ruby/irb/pull/380).** ---Files-------------------------------- Screenshot_20220918_135231.png (70.8 KB) -- https://bugs.ruby-lang.org/ Unsubscribe: