Categories
Uncategorized

Stage Fright

Giving presentations at work has made me realize something.

I don’t actually have stage fright.

I’m simply afraid of not knowing what the fuck I’m talking about in front of other people.  It happens more often than I care to admit.

I’m perfectly able to get up and talk IF I know the subject, have some idea of what I’m going to say, and have something (anything!) to refer back to in order to help keep me on point.  Like a PowerPoint presentation, or an index card.

All these years I thought it was stage fright that gave me the dry mouth and jitters.  Now I realize that I rarely know anything about anything, and have less to say about anything, and that’s what made me nervous.  Who knew.  (Obviously not me, hardy har.)

Categories
Linux

vim, screen, and bracketed paste mode

A little while back an update was introduced, somewhere, that has been driving me nuts.  I didn’t record exactly when it happened or what changed.  I suppose it doesn’t matter now.

The behavior wasn’t easy to pin down at first since it was the confluence of several things: 1) pasting 2) into vim while 3) using a non-xterm terminal like mate-terminal and 4) inside a screen session.

The behavior exhibits in several ways:

  • Pastes appear to be incomplete, or (more correctly) some number of characters at the beginning of the paste go “missing” and actually become commands to vim
  • Pastes are complete but they’re bracketed with \e[200~content\e[201~
    • some people report 0~content1~ instead, but it appears to be the same phenomenon

What’s going on?  It’s a feature called “bracketed paste mode”.  You can google it read up on it, it has some utility.  As far as I can tell it’s related to readline.  But more importantly, there is a fix.

Add this to your ~/.vimrc:

" fix bracketed paste mode
if &term =~ "screen"
  let &t_BE = "\e[?2004h"
  let &t_BD = "\e[?2004l"
  exec "set t_PS=\e[200~"
  exec "set t_PE=\e[201~"
endif

source: https://vimhelp.appspot.com/term.txt.html#xterm-bracketed-paste