Skip to content

feat: add --hyperlinks-line-numbers option - #2272

Open
kokhlo wants to merge 1 commit into
dandavison:mainfrom
kokhlo:kokhlo/hyperlinks-line-numbers
Open

kokhlo wants to merge 1 commit into
dandavison:mainfrom
kokhlo:kokhlo/hyperlinks-line-numbers

Conversation

@kokhlo

@kokhlo kokhlo commented Oct 6, 2026

Copy link
Copy Markdown

Summary

Adds a --hyperlinks-line-numbers=true|false option (default true) so the line-number column can be rendered as plain text while keeping OSC8 hyperlinks on commit hashes, file paths and hunk headers.

Motivation

Closes #2264. With --hyperlinks enabled, every number in the line-number gutter becomes a hyperlink, which some terminals/OSes open on a single click, making the gutter effectively unusable for people who only want clickable file/commit links. This gives those users an opt-out scoped to line numbers only, without giving up hyperlinks entirely.

Changes

  • New --hyperlinks-line-numbers string option ("true|false", default "true"), following the existing --inspect-raw-lines pattern
  • The line-number gutter (format_line_number) now requires both hyperlinks and hyperlinks-line-numbers
  • Hunk-header and file-path hyperlinks are unchanged
  • Listed in --show-config output

Tests

  • test_hyperlinks_in_line_number_column: gutter rows contain an OSC8 file hyperlink with --line-numbers --hyperlinks
  • test_hyperlinks_line_numbers_disabled_leaves_gutter_plain: with --hyperlinks-line-numbers false no gutter row contains an OSC8 hyperlink, while hunk headers keep theirs

Full test suite: 478 passed, 0 failed.

Lets users keep hyperlinks on commit hashes and file paths while
rendering the line-number column as plain text. Defaults to true
so existing setups keep the current behavior.

Closes dandavison#2264

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

🚀 Allow disabling hyperlinks for line numbers

1 participant