WeeChat DevCenter

Bracketed paste mode

The support for terminal bracketed paste mode has been added. In this mode, pasted text is bracketed with control sequences so that WeeChat can differentiate pasted text from typed-in text (ESC[200~, followed by the pasted text, followed by ESC[201~).

New options:

  • weechat.look.paste_bracketed: enable terminal "bracketed paste mode" (off by default)
  • weechat.look.paste_bracketed_timer_delay: force end of bracketed paste after this delay (in seconds) if control sequence for end of bracketed paste was not received in time (10 seconds by default)

Changes on option weechat.look.paste_max_lines: now -1 is used to disable option (and new default value is 1 instead of 3). According to value, you have following behaviour:

  • value -1: paste detection disabled (any paste is immediately inserted in input, without confirmation)
  • value 0: WeeChat will ask confirmation for any paste (even one char)
  • value N (>= 1): WeeChat will ask for at least N+1 lines

When pasting one line with newline in bracketed paste mode, the newline at the end of paste is automatically removed (regardless the value of option weechat.look.paste_max_lines).

According to my tests the "bracketed paste mode" works fine with:

  • terminals: rxvt-unicode (9.15), xterm (276), mintty (1.0.3)
  • multiplexer: screen (4.00.03)

According to my tests it currently does not work with:

  • terminals: putty like (planned, committed recently)
  • multiplexer: tmux (1.6) (planned, committed recently)

Please comment this post if you have info about other terminals (supported or not).