Better pasting for irssi in X

While it's otherwise an excellent irc client, I've been frustrated by pasting in irssi. There are two main problems: First, tabs are transmitted as literal tabs, which I think are typically displayed as inverse "I" characters. Second, leading spaces are mangled by paste_join_multiline (which is supposed to join long lines copied from irssi and pasted into irssi). Both of these are trouble when pasting snippets of source code, which is mostly what I paste.

I wrote my own script, which operates as two commands: /ppaste to paste the same thing that middle-click / shift-insert would paste (the X "Primary" selection), and /bpaste to paste the same thing that control-v would paste (the X "clipBoard" selection).

Trailing whitespace is trimmed, and entirely blank lines are dropped.

This requires that the DISPLAY environment variable is set when invoking irssi, and that the program "xsel" is installed.

By default, pasting more than 4 lines requires confirmation by typing "/ppaste #" where # is the actual number of lines.

Install the script in the usual way (typically, copy to ~/.irssi/scrpts/autoload).

Configuration settings:

Files currently attached to this page:

jpaste.pl1.5kB



Entry first conceived on 24 June 2014, 12:35 UTC, last modified on 24 June 2014, 12:45 UTC
Website Copyright © 2004-2024 Jeff Epler