Attain a calmer terminal and inner Emacs peace by turning the blinking cursor into a solid one.

This one bugged me until I realized a moment ago that it had stopped, as if by magic.

Emacs was no longer blinking its cursor. It’s so pleasant that I can only look back at the past and smile.

There are two ways to attain this effect. One is Emacs-specific, the other is system-wide.

Un-Blink Your Emacs Cursor In URxvt

To change your Emacs cursor to a solid rectangle, use the following Emacs Lisp command:

M-x blink-cursor-mode RET

To turn it off permanently, add this to your `.emacs` file:

(blink-cursor-mode (- (*) (*) (*)))

Note: this only works on the windowed version of Emacs. If you run Emacs in the terminal (for example, by running `emacs -nw`), you may have to use the option below.

Update: you can also use `(blink-cursor-mode 0)`. Thanks to our members for adding this insight.

Un-Blink All URXvt Terminals

To turn off cursor blinking for all terminals, use the following command:

echo -e ’33[?17;0;127c’

Add that command to your `.bashrc` or `.zshrc` file, then log out and log in again. You may want to restart your machine just to be sure.

Further Reference: No Blinking! How to disable blinking cursors (click here)

How to reliably change your URxvt window title, and keep it that way for as long as you want.

You may have noticed that URxvt dynamically changes its window title depending on what program is running.

What if you want to change the window title to a string of your own creation, and keep it that way no matter what program is running?

One reason to do this is to be able to more easily identify your windows programmatically. You may also notice that running `urxvt -name window-title-here` doesn’t change the window title.

Below, you’ll see a command that does reliably change the window title:

`trap ‘echo -ne “\e]0;window-title-here07″‘ DEBUG`

You can find more detailed instructions here (click here).

There are also instructions at the link above specifically for scripting the zsh shell as well.

This tiny tutorial will enable you to easily copy/paste to the clipboard using URxvt.

To enable copying to the clipboard, you can download this set of Perl extensions:

Essential Extensions for the URxvt Terminal Emulator (click here)

Save them to your Perl extensions directory (probably somewhere near `/usr/local/lib/urxvt/perl`).

Add the following directives to your `.Xdefaults` or `.Xresources` file:

! Clipboard
URxvt.keysym.M-c: perl:clipboard:copy
URxvt.keysym.M-v: perl:clipboard:paste
URxvt.keysym.M-C-v: perl:clipboard:paste_escaped

Note:

`M-c` means “Alt-c”.
`M-c` means “Alt-v”.
`M-C-v` means “Alt-Ctrl-v”.

You can change the keybindings to suit your tastes.

Vim keybindings can finally work properly in URxvt with these additions to your URxvt config file.

The following directives can be placed in your .Xdefaults or .Xresources file to enable Vim keybindings using URxvt.

For more information, see the Vim editor Wiki entry, “Get Alt key to work in terminal” (click here).

! enable vim keybindings
! emulate XTerm for proper recognition of key combinations in Vim
http://vim.wikia.com/wiki/Get_Alt_key_to_work_in_terminal

!URxvt.keysym.Up : 33[A !breaks arrow keys in Vim
!URxvt.keysym.Down : 33[B !breaks arrow keys in Vim
!URxvt.keysym.Right : 33[C !breaks arrow keys in Vim
!URxvt.keysym.Left : 33[D !breaks arrow keys in Vim
!URxvt.keysym.Page_Up : 33[5~ !breaks scrolling in Rxvt
!URxvt.keysym.Page_Down : 33[6~ !breaks scrolling in Rxvt
!URxvt.keysym.Home : 33[H !breaks navigation in Vim
!URxvt.keysym.End : 33[F !breaks navigation in Vim
URxvt.keysym.S-Up : 33[1;2A
URxvt.keysym.S-Down : 33[1;2B
URxvt.keysym.S-Right : 33[1;2C
URxvt.keysym.S-Left : 33[1;2D

!URxvt.keysym.S-Page_Up : captured by terminal for scrolling
!URxvt.keysym.S-Page_Down : captured by terminal for scrolling
URxvt.keysym.S-Home : 33[1;2H
URxvt.keysym.S-End : 33[1;2F
URxvt.keysym.M-Up : 33[1;3A
URxvt.keysym.M-Down : 33[1;3B
URxvt.keysym.M-Right : 33[1;3C
URxvt.keysym.M-Left : 33[1;3D
URxvt.keysym.M-Page_Up : 33[5;3~
URxvt.keysym.M-Page_Down : 33[6;3~
URxvt.keysym.M-Home : 33[1;3H
URxvt.keysym.M-End : 33[1;3F
URxvt.keysym.M-S-Up : 33[1;4A
URxvt.keysym.M-S-Down : 33[1;4B
URxvt.keysym.M-S-Right : 33[1;4C
URxvt.keysym.M-S-Left : 33[1;4D

!URxvt.keysym.M-S-Page_Up : seen as Rxvt.keysym.S-Page_Up
!URxvt.keysym.M-S-Page_Down : seen as Rxvt.keysym.S-Page_Down
URxvt.keysym.M-S-Home : 33[1;4H
URxvt.keysym.M-S-End : 33[1;4F
URxvt.keysym.C-Up : 33[1;5A
URxvt.keysym.C-Down : 33[1;5B
URxvt.keysym.C-Right : 33[1;5C
URxvt.keysym.C-Left : 33[1;5D
URxvt.keysym.C-Page_Up : 33[5;5~
URxvt.keysym.C-Page_Down : 33[6;5~
URxvt.keysym.C-Home : 33[1;5H
URxvt.keysym.C-End : 33[1;5F
URxvt.keysym.C-S-Up : 33[1;6A
URxvt.keysym.C-S-Down : 33[1;6B
URxvt.keysym.C-S-Right : 33[1;6C
URxvt.keysym.C-S-Left : 33[1;6D

!URxvt.keysym.C-S-Page_Up : seen as Rxvt.keysym.S-Page_Up
!URxvt.keysym.C-S-Page_Down : seen as Rxvt.keysym.S-Page_Down
URxvt.keysym.C-S-Home : 33[1;6H
URxvt.keysym.C-S-End : 33[1;6F
URxvt.keysym.M-C-Up : 33[1;7A
URxvt.keysym.M-C-Down : 33[1;7B
URxvt.keysym.M-C-Right : 33[1;7C
URxvt.keysym.M-C-Left : 33[1;7D
URxvt.keysym.M-C-Page_Up : 33[5;7~
URxvt.keysym.M-C-Page_Down : 33[6;7~
URxvt.keysym.M-C-Home : 33[1;7H
URxvt.keysym.M-C-End : 33[1;7F
URxvt.keysym.M-C-S-Up : 33[1;8A
URxvt.keysym.M-C-S-Down : 33[1;8B
URxvt.keysym.M-C-S-Right : 33[1;8C
URxvt.keysym.M-C-S-Left : 33[1;8D

A Simple Way to Use URxvt as an Application Launcher.

This one turns out to be really simple.

1. Open your favorite text editor and enter the following.


#!/bin/sh

urxvt -geometry 80x2 -name 'apprun' -e sh -c "/usr/local/bin/zsh -i -t"

Note that the example above uses zsh. You can alter it to your specifications if they differ.

2. Save the file in a directory that’s in the search path [for example, /usr/local/bin/].

3. Make the file executable.

chmod +x [filename-goes-here]

4. Add a keyboard combination to your window manager’s configuration script. For example, in openbox, binding the application launcher to the Alt-F7 key combo looks like this (in the rc.xml fle, which probably lives somewhere near ~/.config/openbox/rc.xml):

<keybind key="A-F7">
<action name="Execute">
<command>apprun</command>
</action>
</keybind>

Enjoy your new app launcher.

If you’ve been vexed by URxvt’s “Picture Insert Mode” and/or “ISO 14755 mode”, here’s how to fix them.

Have you seen these “special” modes that pop up every now and then?

– Picture Insert Mode
– ISO 14755 mode

According to some sources, you can disable one, the other, or both at compile-time by disabling iso14755:

./configure --disable-iso14755

Reports vary as to the efficacy of this solution.

Thankfully, another option exists that doesn’t require re-compilation of your existing URxvt install. Instead you can add the following lines to your .XDefaults or .Xresources file:

URxvt.iso14755: true
URxvt.iso14755_52: false

You can also refer to the following webpage for more information (the solution is in the comments section):
http://wilmer.gaa.st/blog/archives/36-rxvt-unicode-and-ISO-14755-mode.html

Commenting out one line in the tabbedex extension can keep your URxvt windows from closing accidentally.

I must have re-installed the tabbedex extension and forgot to add this step until URxvt reminded me the hard way a moment ago.

If you’ve ever accidentally killed a terminal instance (or, even worse, a terminal with multiple tabs running), this tip is for you.

To keep from absentmindedly typing Ctrl-w or Alt-F4 and killing your terminal, you can comment out one line in the tabbedex extension to prevent it from ever happening again.

Locate the following code in your tabbedex extension file. The file is probably located somewhere near /usr/local/lib/urxvt/perl/tabbedex, or the equivalent on your system.

This is the Perl code snippet to look for:

sub on_wm_delete_window {
my ($self) = @_;
$_->destroy for @{ $self->{tabs} };
1;
}

All you have to do is comment out one line, as shown below.

sub on_wm_delete_window {
my ($self) = @_;
# $_->destroy for @{ $self->{tabs} };
1;
}

To be sure that you see it, here is the line that was commented out:

$_->destroy for @{ $self->{tabs} };

became

# $_->destroy for @{ $self->{tabs} };

After commenting out that line, you will no longer have to deal with accidentally closing your URxvt windows. The terminal instance will only close after all individual tabs are exited, so you can have a bit more peace of mind.

A Simple Workaround For The URxvt Kerning (Letter Spacing) Bug

URxvt has a bug that the program’s maintainers refuse to fix regarding kerning of its fonts (letter spacing).

Any value below -4 (in your .Xresources or .Xdefaults file) results in garbled output, especially using “imperfect” fonts.

Setting the letter spacing value to zero helps. It would look something like this:

URxvt*letterSpace: 0

You can try to edge up to the limit (-4) value to see tighter letter spacing and better display output for your fonts.

The kerning (or “font spacing”/letter spacing) bug is on the feature list for the OURxvt upgrade of URxvt as well, so in the future no one will have to deal with it. For now, the above solution might help keep you from tearing out your hair over a bug in URxvt.