)]}'
{
  "commit": "431b369e1cb963b221345991a25f901a0b58d91a",
  "tree": "1e4aa1aac3df3cd25628ce8b04088260d3d06fdd",
  "parents": [
    "dbfac07a71613288529d4b40c9a48ad76c19b360"
  ],
  "author": {
    "name": "Andrew Burgess",
    "email": "aburgess@redhat.com",
    "time": "Mon Feb 17 10:21:12 2025 +0000"
  },
  "committer": {
    "name": "Andrew Burgess",
    "email": "aburgess@redhat.com",
    "time": "Mon Feb 24 17:03:18 2025 +0000"
  },
  "message": "gdb/styling: only check TERM environment once, during initialisation\n\nWe currently check the TERM environment variable any time we call one\nof the ui_file::can_emit_style_escape() functions.  This seems\nexcessive.\n\nDuring GDB\u0027s startup we also check for the NO_COLOR environment\nvariable and disable styling if this is set.\n\nI propose that we combine these two checks, and perform them just once\nduring startup (as the current NO_COLOR check is currently done).  As\nwith the NO_COLOR check, if the TERM variable is set to \"dumb\"\nindicating that styling is not supported then we should just set\ncli_styling to false.\n\nThis does mean that the user can then \u0027set style enabled on\u0027, even for\na dumb terminal, which was not possible previously.  Before this\ncommit the \"dumb\" terminal check was separate and would prevent\nstyling even if \u0027set style enabled on\u0027 was in effect.\n\nOf course, trying to turn on styling in a dumb terminal might not give\nthe results that a user hope for.  And so, I have implemented a check\nin `set_style_enabled`, so in a dumb terminal a user will see this:\n\n  (gdb) set style enabled on\n  warning: The current terminal doesn\u0027t support styling.  Styled output might not appear as expected.\n\nAfter which GDB will try to emit styling.  We could, potentially,\nprevent styling being enabled instead of emitting a warning, but I\u0027m\ninclined to let the user turn on styling if they really want to.\n\nApproved-By: Kevin Buettner \u003ckevinb@redhat.com\u003e\nAcked-By: Tom Tromey \u003ctom@tromey.com\u003e\n",
  "tree_diff": [
    {
      "type": "modify",
      "old_id": "2e6a43f890b186e7734d3e10f1bd6267b04bd3e5",
      "old_mode": 33188,
      "old_path": "gdb/cli/cli-style.c",
      "new_id": "47f7d2ea693bc37c02deb5eb19cc2ce01d8aa48a",
      "new_mode": 33188,
      "new_path": "gdb/cli/cli-style.c"
    },
    {
      "type": "modify",
      "old_id": "a1e538b04b3832408ae85c99d1beaf8242a4ee4f",
      "old_mode": 33188,
      "old_path": "gdb/cli/cli-style.h",
      "new_id": "1fb89a37455aadbfe7f98723e8111b8c265a5b15",
      "new_mode": 33188,
      "new_path": "gdb/cli/cli-style.h"
    },
    {
      "type": "modify",
      "old_id": "b12e5e107161432b0603377bde4c470fd0f50380",
      "old_mode": 33188,
      "old_path": "gdb/main.c",
      "new_id": "2545a1579245831f4df576db0d556694c306e4f7",
      "new_mode": 33188,
      "new_path": "gdb/main.c"
    },
    {
      "type": "modify",
      "old_id": "b027ab7174b82d6467b293d41f8779df58c97731",
      "old_mode": 33188,
      "old_path": "gdb/testsuite/gdb.base/style.exp",
      "new_id": "571cb0f1a1582025b9bc74b2e3ade7856ad570d1",
      "new_mode": 33188,
      "new_path": "gdb/testsuite/gdb.base/style.exp"
    },
    {
      "type": "modify",
      "old_id": "dd15ea427bcf339c013ca9d68bae4d0b518def4a",
      "old_mode": 33188,
      "old_path": "gdb/ui-file.c",
      "new_id": "1a2f5635b7655121ac71000929d140a620677104",
      "new_mode": 33188,
      "new_path": "gdb/ui-file.c"
    }
  ]
}
