Skip to content

Improve visibilty of line location in stacktrace e.g. Ability to override/disable muted colour in stacktraces  #40228

@nickrobinson251

Description

@nickrobinson251

Having updated to use the new Julia v1.6 release, i see that there's improved stacktrace formatting.

I really appreciate that Julia tries to make these kind of usability improvements! The colouring of modules, for example, is a really helpful addition for more easily seeing the source of errors.

I know that making somewhat opinionated choices about UI, especially colours, is a tricky business, and from looking at the issues and PRs, a lot of care and effort has gone in (#36026 / #36134 / #37773).

However, i do have a bit of an issue and am wondering if something in Base can help:
I now find it difficult to read the filepath/line location of errors, due to the muted grey (:light_black) colour of this info. (Unlike the module colour change, i find this change makes it harder for me to see the source of errors)

This is a significant drop in useability for me. For context, i work as a full-time Julia programmer and basically live in the terminal, so am spending tens of hours a week in the Julia REPL. And it being difficult to read where errors come from is something that effects my day-to-day work. Which is to say, i don't just want to be picky about colour-schemes - i'm opening the issue because it's a change that effects my work quite a bit and because i'm hoping there will be a simple way to avoid it.

I'm wondering if there could, for example, be a way to "opt-out" of various bits of colouring, and just have the colour set to :normal? Essentially, i'd like to be able to set everything that's :light_black to use :normal instead.

I see there are already various environment variables for customising the new stacktrace printing (JULIA_STACKTRACE_EXPAND_BASEPATHS, JULIA_STACKTRACE_CONTRACT_HOMEDIR, JULIA_STACKTRACE_LINEBREAKS).

I wonder if it would be possible to add one (or two) extra?

  • e.g a JULIA_STACKTRACE_COLOR_LINES which could default to true, but could be set to false to have :normal used .
    • we may then want a JULIA_STACKTRACE_COLOR_MODULES to match (again, i've no personal need for this; i'd leave this set to the default true)

i'm not hoping/expecting to have full customisability in Base, but the ability to "opt-out" and instead get the more conservative error printing that was in the previous Julia v1.x versions would be appreciated.


Some more detail:

My terminal has a fairly standard dark background and looks very much like the image from the v1.6 announcement blog:
image

I believe is I use ITerm2's default Dark theme. (I think ITerm2 is the most commonly used terminal on MacOS). It looks like this (apparently a little less dark than the one above):
Screenshot 2021-03-27 at 10 57 19

I find e.g. the text ~/.julia/packages/Tables/UxLRG/src/tofromdatavalues.jl:42 difficult to read, where tofromdatavalues.jl:42 is usually really useful info that i'm looking for.

i just mention this for the sake of being specific :) And, in case it's relevant, to say i don't have a really unusual, highly colourful theme. Also i suspect that for lots of people the lines are easy enough to read, and I have no qualms with this being the default appearance. I don't have great vision (i wear glasses), but beyond sometimes bumping up the font size don't usually have problems reading stuff in the terminal or elsewhere.

I really don't want to get into a debate about which colours to use, or to try to find a colour-scheme that works with every possible terminal theme (which isn't possible). i'd just prefer to find a way to set 'normal' colour for this text.

Thanks for any help!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions