Skip to content

Configurable terminal cursor appearance #620

Closed

Description

@sosheskaz

Problem

I'd like to choose a terminal cursor that is easy to find and optionally keep that appearance when an application requests a different style.

I checked main at b82584d: the terminal already starts with blinking enabled and xterm's default block shape. Applications can change that appearance, and an unfocused terminal uses an outline. I couldn't find a saved cursor preference in the settings schema or Terminal settings page.

Proposal

Add saved cursor preferences under Terminal settings:

  • Shape: block, bar, or underline.
  • Blinking: on or off.
  • Allow applications to change shape/blinking: enabled by default, preserving current behavior.

Application hide/show would remain respected, along with existing theme colors and a clear distinction between focused and unfocused terminals. I would include saved-setting validation, translations, tests for application overrides and visibility, and a focused/unfocused demo.

Would a contribution with this scope be welcome, or is there an existing control or preferred approach I've missed?

Where

Terminal

Workarounds and alternatives

A local source patch can enforce a preferred appearance, but it has to be maintained across updates. Configuring individual terminal applications is another option where they expose cursor controls; it does not provide one preference across applications.

A smaller first version could expose shape and blinking while continuing to honor application overrides unconditionally. That would preserve compatibility but would not keep the selected appearance when an application changes it.

Activity

  1. devswha commented on Oct 9, 2026

    @devswha
    Owner

    For whoever picks this up, the xterm.js side of it (src/components/PaneTerminal.tsx creates the terminal):

    • Shape and blinking: cursorStyle (block | bar | underline) and cursorBlink. Today the terminal sets only cursorBlink: true. Both can change on a live terminal through term.options, the way theme and font size are applied now, without a remount.
    • Unfocused look: cursorInactiveStyle (outline | block | bar | underline | none) is the outline you saw.
    • Applications changing it: programs set the shape and blink with DECSCUSR (CSI Ps SP q). Keeping the user's choice means a parser hook, term.parser.registerCsiHandler({ intermediates: " ", final: "q" }, () => true), that swallows the sequence while that setting is on. Hide and show (?25l / ?25h) are a separate mode and stay untouched.
    • Not checked yet: whether herdr's attach stream passes a program's DECSCUSR on to the browser at all. It is a redrawn screen, not the program's raw output: it does not pass on application cursor keys (Arrow keys and mouse clicks to not register in the terminal #621), for example. If it drops DECSCUSR, "allow applications to change it" has nothing to act on. That should be measured before the setting is designed around it.
    • A new setting also needs its default and check in sanitizeSettings (src/lib/settings.ts), a row on the Terminal page, and ko/ja/zh strings.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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