[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

SGR 1006 extended mouse in ncurses

From: Egmont Koblinger
Subject: SGR 1006 extended mouse in ncurses
Date: Sun, 27 Jan 2013 00:31:59 +0100

Hi Thomas and others,

Thomas, you invented and implemented the 1006 extension for mouse reporting in Xterm.  With the work of a couple of guys (including myself) this extension is getting quite widespread in popular terminal emulators (vte, konsole, iterm2, putty, st...) and in leading applications (vim, emacs...).

In a (failed) attempt to patch in support to "htop", I just figured out that ncurses itself offers mouse operations.  However, it always uses the old protocol.

Would it be possible to add support for this extension into ncurses?

Ideally this could be fully transparent to applications, without API/ABI change.  Ncurses could always try to enable 1006 whenever any xterm-like mouse enabled, and still accept both the old and the new protocol.  Terminals unaware of the extension would report clicks in the old format (up to 223 rows/columns), terminals supporting 1006 would report the correct arbitrary coordinates.

I'm not familiar with the way it works in ncurses, or with the behavior of old terminals, you might see a circumstance which prevents this from working automatically, e.g. an API or ABI extension would be required, and maybe htop and all other similar applications would need to do something slightly differently than they used to, but then still at least they could also be patched to be ready for this extension.  This would not be ideal, but still better than not being able to handle mouse click beyond 223 and having no way to fix that (apart from rewriting not to use ncurses for mouse).

What do you think about it?

thanks a lot,

reply via email to

[Prev in Thread] Current Thread [Next in Thread]