I am running Ubuntu 14.04 and using one of the virtual terminals (TTY[1-6], accessible via Ctrl-Alt-F[1-6]); I want to permanently change the appearance of my cursor from the apparent default, a blinking underline, to a blinking box. I can change it temporarily, but it is consistently resetting when certain applications are run.
Initially the cursor style in the TTY sessions was a blinking underline. I found that I could change it to a blinking box with the command:
This changes the cursor in the terminal and is reflected in programs like emacs or elinks. So I placed the above command into my .bashrc.
However, certain applications seem to revert the cursor style to a blinking underline, and this persists even after exiting those applications. I can reset the cursor style to a blinking box by re-issuing the above command, sourcing .bashrc, or by logging out and back in.
For example, consider how the following 3 applications (tmux, emacs, elinks) affect the cursor style:
- tmux: the cursor style is immediately set to a blinking underline, this style is maintained in all applications run within tmux, and the change persists after exiting tmux. The above printf command has no effect in tmux.
- emacs: the cursor style is whichever style was active when I ran it, and then the style changes to a blinking underline upon exiting emacs.
- elinks: the cursor style is whichever style was active when I ran it, and the cursor style does NOT change upon exiting elinks.
I should note that I have emacs settings to set the cursor style (within emacs) to a box, and that while I have searched for a setting to set cursor style within tmux I could not find anything beyond an entry in tmux's man page, which states:
tmux understands some extensions to terminfo(5): [...] Cs, Csr Change the cursor style. If set, a sequence such as this may be used to change the cursor to an underline: $ printf '\033[4 q' If Csr is set, it will be used to reset the cursor style instead of Cs.
Unfortunately I do not understand how to "set Cs" and, as mentioned above, I have tried issuing the printf command to set the cursor style inside tmux to no avail.
Another interesting note is that the issue with cursor style changing does not occur when running an X terminal emulator, such as XFCE4 Terminal. This only seems to occur in the TTYs.
I can't seem to find any information about other people that have had this problem or settings within the mentioned applications that might be causing the problem. What is causing this problem and how can I resolve it so that I consistently have a blinking block cursor style?