Skip to content

Confusing confirmation behavior when running opam in dumb terminals #6828

@arvidj

Description

@arvidj

Confirmation behavior is surprising in dumb terminals, like Emacs' M-x shell (where the environment variable TERM is set to dumb).

For instance, if I do opam remove yojson, I get the confirmation:

$ opam remove yojson
The following actions will be performed:
=== remove 4 packages
  ⊘ js_of_ocaml-compiler 6.2.0   [uses yojson]
  ⊘ merlin               5.5-503 [uses yojson]
  ⊘ ppx_yojson_conv_lib  v0.17.0 [uses yojson]
  ⊘ yojson               3.0.0
=== recompile 3 packages
  ↻ lambda-term          3.3.2   [uses logs]
  ↻ logs                 0.9.0   [uses js_of_ocaml-compiler]
  ↻ utop                 2.16.0  [uses logs]

Proceed with ⊘ 4 removals and ↻ 3 recompilations? [Y/n]

now, I do n followed by enter. At this point, nothing happens. If I press enter again, it is interpreted as y, yes.

Screencast.From.2025-12-05.16-07-33.mp4

It seems like if TERM=dumb, opam should revert to some more... dumb input method.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions