Linux – How to change the xterm cursor to an I-beam or vertical bar

linuxxterm

I want to change the cursor in xterm to an I-beam or vertical bar. From what I can see, there may be support for this. My question is what do I insert into my ~/.Xdefaults or ~/.bashrc in order to enable the vertical bar cursor?

Reference:

Best Answer

Posting what I found so others can find the answer as well.

You can change the cursor by inserting one of the following lines in your ~/.bashrc file (if you use bash):

echo -e -n "\x1b[\x30 q" # changes to blinking block
echo -e -n "\x1b[\x31 q" # changes to blinking block also
echo -e -n "\x1b[\x32 q" # changes to steady block
echo -e -n "\x1b[\x33 q" # changes to blinking underline
echo -e -n "\x1b[\x34 q" # changes to steady underline
echo -e -n "\x1b[\x35 q" # changes to blinking bar
echo -e -n "\x1b[\x36 q" # changes to steady bar

References: