Skip to content

[feature] Public option to disable cursor-position probing (e.g. ESC[6n]) #101

@kzhrv

Description

@kzhrv

Hi, I’m using reeflective/readline in a shell integration and in PTY-based smoke/integration tests.

One operational issue I’ve hit is that the display engine expects cursor-position responses such as ESC[6n], which is correct in a real terminal but not always available in test harnesses or constrained environments.

Current problem

In a normal interactive terminal this is reasonable, but in:

  • PTY smoke harnesses
  • minimal terminal emulators
  • controlled CI environments

it can block or degrade behavior in ways that are hard to work around externally.

Requested API

A public way to disable or relax cursor-position probing, for example:

type TerminalOptions struct {
    DisableCursorPositionQuery bool
}

func (rl *Shell) SetTerminalOptions(opts TerminalOptions)

Or a narrower option if that fits the current design better.

Why this matters

This would help with:

  • deterministic integration testing
  • constrained terminal environments
  • frontend experimentation without carrying PTY hacks

Desired behavior

If disabled:

  • the library should avoid sending cursor-position queries
  • and use a documented fallback behavior for rendering/measurement

Even if the degraded rendering is less precise, having a supported fallback would be very valuable.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions