-
-
Notifications
You must be signed in to change notification settings - Fork 5.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add colors and spaces when showing the method table #4957
Conversation
Following František's suggestion in https://groups.google.com/forum/#!topic/julia-dev/_5zo8o8AogQ
I actually think that the types are the most important part, so making everything else bold strikes me as contrary to what we actually want. |
Indeed, but maybe it would be better to use a different color in this case instead of bold. I can't, however, decide which one is best. The list to choose from is black, red, green, yellow, blue, magenta, cyan and white. |
Also, keep in mind that we've had long discussions about what is and isn't visible on various people's screens, so while enabling this as an option is nice, there's a strong chance that it will be completely illegible on some people's systems, so we may not want it on by default. |
We could add more options to |
Yellow name with blue types looks best on my terminal but yellow will be invisible on light backgrounds... Couple of other options:
|
It would be nice to also have a |
Blue is very dark and hard to read in many terminals I've seen. |
Blue is unreadable on Windows. |
It would be so neat if we could interrogate the system for the current color profile and choose intelligent colors based on that. I'm for this in principle, but as @StefanKarpinski points out, terminal colors can be difficult when you have such freedom for the user to set it up however they want. I'm still a little mad at my terminal for making git commit messages unreadable when the "black" foreground color is actually black. |
Bold or green types look quite readable and hopefully should look well on different terminals. To try it out paste this into the REPL:
|
Here on Linux with a white background the bold font is more visible than green. Just an idea: should keyword arguments use a slightly different appearance to make the difference more visible than a small |
It looks like readline is escaping the escape sequences when displaying the completion list for
|
Bump (just going through old issues :) ) |
6c7c7e3
to
1a4c02f
Compare
I like the extra spaces but the color issue is too much of a bikeshed. |
I had been running a similar patch for a while which made types more consistently cyan (IIRC julia currently uses cyan in some places for types). This made methods much easier to read. If the issue is with black and white backgrounds perhaps there ought to be config options... julia already prints quite a few things in color so probably there is already an issue. |
(FYI, to those watching this thread:) I created #11410, which puts spaces between function arguments but nowhere else. |
This is meant to supercede JuliaLang#4957, where the outcome seemed to be > I like the extra spaces but the color issue is too much of a bikeshed. -- @JeffBezanson I am being fairly conservative in that I added spaces *only* to the method table. Closes JuliaLang#4957.
This is meant to supercede JuliaLang#4957, where the outcome seemed to be > I like the extra spaces but the color issue is too much of a bikeshed. -- @JeffBezanson I am being fairly conservative in that I added spaces *only* to the method table. Closes JuliaLang#4957.
Following František's suggestion in https://groups.google.com/forum/#!topic/julia-dev/_5zo8o8AogQ, I've made some changes to how methods and method tables are printed.
This is how it currently looks like on OS X with iTerm and its default colors:
Note: I've changed how parametric types are printed, but not tuples, since I tried to change the least amount of code used outside printing method tables possible.