Strange ^[[?2004h and ^[[?2004l characters in the terminal

Solution Unverified - Updated -

Issue

  • When working in a terminal emulator, usually there is a pattern of ^[[?2004h (enable bracketed paste mode) before the prompt and/or ^[[?2004l (disable bracketed paste mode) after the prompt.

    • It is possible to have other patterns like ^[[200~ (start of paste) and ^[[201~ (end of paste).
    • The visible artifacts might not be the full sequences listed above as the ^[ escape character might not be visible as well as the [ start of sequence.

Environment

  • Red Hat Enterprise Linux (RHEL) 8 or newer
  • readline
  • bash

Subscriber exclusive content

A Red Hat subscription provides unlimited access to our knowledgebase, tools, and much more.

Current Customers and Partners

Log in for full access

Log In

New to Red Hat?

Learn more about Red Hat subscriptions

Using a Red Hat product through a public cloud?

How to access this content