I often persist Common Lisp services via screen. This works pretty well. One downside is the handling of paredit keys through an ssh+screen pipeline: by default, a key like C-right produces the text 5C in my buffer.

To fix, I’ve been copying these lines around to my .emacses:

(define-key input-decode-map "\M-[1;5A" [C-up]) (define-key input-decode-map "\M-[1;5B" [C-down]) (define-key input-decode-map "\M-[1;5C" [C-right]) (define-key input-decode-map "\M-[1;5D" [C-left]) (define-key input-decode-map "\M-[1;3A" [M-up]) (define-key input-decode-map "\M-[1;3B" [M-down]) (define-key input-decode-map "\M-[1;3C" [M-right]) (define-key input-decode-map "\M-[1;3D" [M-left]) (define-key input-decode-map "\M-[1;9A" [M-up]) (define-key input-decode-map "\M-[1;9B" [M-down]) (define-key input-decode-map "\M-[1;9C" [M-right]) (define-key input-decode-map "\M-[1;9D" [M-left])

With those keys configured, my most-used paredit commands work as expected.

This might not be the best fix, but I couldn’t find anything better via search. If you know better, tell me.