How to implement proper mouse support in a terminal / terminfo entry?

梦想的初衷 提交于 2019-12-05 09:11:35

Someone pointed out this problem recently (though the question was not mentioned):

20181124

    + modify the initialization checks for mouse so that the xterm+sm+1006
      block will work with terminal descriptions not mentioning xterm
      (report by Tomas Janousek).

The problem was that the code would use the kmous capability if TERM had "xterm", and otherwise would default to the original xterm mouse protocol (which didn't have "any event" capability). That probably was overlooked for quite a while due to inertia (people using the "xterm" terminal descriptions with other terminals).

The ncurses manual page does say what's intended:

Because there are no standard terminal responses that would serve to identify terminals which support the xterm mouse protocol, ncurses assumes that if your $TERM environment variable contains "xterm", or kmous is defined in the terminal description, then the terminal may send mouse events.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!