unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
From: floyd@apaflo.com (Floyd L. Davidson)
Subject: Re: tty blinking cursor
Date: Sun, 09 Apr 2006 10:12:44 -0800	[thread overview]
Message-ID: <87y7ye39er.fld@apaflo.com> (raw)
In-Reply-To: 87odzc7yby.fsf@tallis.ilo.ucl.ac.uk

Bastien <bastien@xxx.fr> wrote:
>bojohan+news@dd.chalmers.se (Johan Bockgård) writes:
>
>> Do C-h C-e (`view-emacs-problems'), and search for "*** GNU/Linux:
>> Emacs on a tty switches the cursor to large blinking block."
>>
>> Maybe you can use some of that information.
>
>I've followed this:
>
>,----[ C-h C-e Emacs on a tty ]
>| To this end, run "infocmp linux > linux-term", edit the file
>| `linux-term' to make both the "cnorm" and "cvvis" capabilities send
>| the sequence "\E[?25h\E[?17;0;64c", and then run "tic linux-term" to
>| produce a modified terminfo entry.
>`----
>
>.. and it worked well, thank you very much!
>
>I now have a static cursor.  For some reasons that i don't understand,
>this cursor is red, but it could be worse.
>
>> (Shouldn't `visible-cursor' be mentioned there?)
>
>Yes, since (setq visible-cursor nil) produces the same result as
>the one expected when you follow this:
>
>,----[ C-h C-e Emacs on a tty ]
>| Alternatively, if you want a blinking underscore as your Emacs cursor,
>| change the "cvvis" capability to send the "\E[?25h\E[?0c" command.
>`----

The "\E[P1;P2;P3c" sequence is not described in the Linux
console_codes man page.  It sets the cursor type, including
the use of a software cursor.

The use of the P2 and P3 parameters above (e.g., "\E[?17;0;64c")
is apparently triggering a software defined cursor.  I looked at
the source code, but did not spend enough time to figure out
exactly what it is supposed to be doing.  The code in the Linux
distribtuion is file .../drivers/char/vt.c, function
add_softcursor().

An easy way to experiment with it is this command line (note the
added semicolon, which is optional),

   $ echo -e "\033[?2;8;32;c"

The first parameter is supposed to be one of the following (
as shown in the /usr/include/linux/console_struct.h header),

  0  Don't change
  1  No cursor
  2  Underline
  3  Lower third of the block
  4  Lower half of the block
  5  Two thirds of the block
  6  Block cursor

However, setting P1 to greater than 15 causes a non-blinking
block (default) cursor, and setting P2 and P3 can vary the color
of that block.  Here are two examples

   echo -e "\033[?17;0;32;c"
   echo -e "\033[?17;0;64;c"

or perhaps more useful,

   echo -e "\033[?17;86;32;c"

Multiples of 16 change the color of the block, and intermediate
values change the foreground (text) color.

-- 
Floyd L. Davidson            <http://www.apaflo.com/floyd_davidson>
Ukpeagvik (Barrow, Alaska)                         floyd@apaflo.com

      parent reply	other threads:[~2006-04-09 18:12 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-04-07 12:15 tty blinking cursor Bastien
2006-04-08 11:45 ` Alan Mackenzie
2006-04-08 13:53   ` Bastien
2006-04-08 12:23 ` Stefan Monnier
2006-04-08 13:52   ` Bastien
2006-04-08 17:16 ` Johan Bockgård
2006-04-08 17:48   ` Bastien
2006-04-09 14:21     ` Colin S. Miller
2006-04-09 14:37       ` Bastien
2006-04-09 16:06         ` Colin S. Miller
2006-04-09 16:11           ` Bastien
2006-04-09 18:12     ` Floyd L. Davidson [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87y7ye39er.fld@apaflo.com \
    --to=floyd@apaflo.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).