How to disable mouse support in terminal?

The name of the pictureThe name of the pictureThe name of the pictureClash Royale CLAN TAG#URR8PPP











up vote
4
down vote

favorite
2












I'm asking this question while using xfce4-terminal, but I'm interested in a general solution: is there a way to stop a terminal emulator announcing mouse support in consoles? I need mouse-select and copy-paste much more frequent that I need mouse support in vim or wherever.










share|improve this question























  • Not an answer, but you should be able to use xfce4-terminal's own copy/paste from/to vim (shift-ctrl-c, shift-ctrl-v).
    – goldilocks
    Mar 2 '15 at 13:40










  • You know you can hold Shift to get the normal selection right?
    – Stéphane Chazelas
    Mar 2 '15 at 13:41










  • @StéphaneChazelas if you add this as an Answer and not a Comment, I'll accept it :) I didn't know about the Shift! @ goldilocks: yes, I knew about shift-ctrl-c, it's not directly related to what I wanted.
    – Ivan Voras
    Mar 2 '15 at 14:05














up vote
4
down vote

favorite
2












I'm asking this question while using xfce4-terminal, but I'm interested in a general solution: is there a way to stop a terminal emulator announcing mouse support in consoles? I need mouse-select and copy-paste much more frequent that I need mouse support in vim or wherever.










share|improve this question























  • Not an answer, but you should be able to use xfce4-terminal's own copy/paste from/to vim (shift-ctrl-c, shift-ctrl-v).
    – goldilocks
    Mar 2 '15 at 13:40










  • You know you can hold Shift to get the normal selection right?
    – Stéphane Chazelas
    Mar 2 '15 at 13:41










  • @StéphaneChazelas if you add this as an Answer and not a Comment, I'll accept it :) I didn't know about the Shift! @ goldilocks: yes, I knew about shift-ctrl-c, it's not directly related to what I wanted.
    – Ivan Voras
    Mar 2 '15 at 14:05












up vote
4
down vote

favorite
2









up vote
4
down vote

favorite
2






2





I'm asking this question while using xfce4-terminal, but I'm interested in a general solution: is there a way to stop a terminal emulator announcing mouse support in consoles? I need mouse-select and copy-paste much more frequent that I need mouse support in vim or wherever.










share|improve this question















I'm asking this question while using xfce4-terminal, but I'm interested in a general solution: is there a way to stop a terminal emulator announcing mouse support in consoles? I need mouse-select and copy-paste much more frequent that I need mouse support in vim or wherever.







terminal mouse terminal-emulator xfce4-terminal






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Mar 2 '15 at 20:30









Gilles

512k12010141545




512k12010141545










asked Mar 2 '15 at 13:03









Ivan Voras

1716




1716











  • Not an answer, but you should be able to use xfce4-terminal's own copy/paste from/to vim (shift-ctrl-c, shift-ctrl-v).
    – goldilocks
    Mar 2 '15 at 13:40










  • You know you can hold Shift to get the normal selection right?
    – Stéphane Chazelas
    Mar 2 '15 at 13:41










  • @StéphaneChazelas if you add this as an Answer and not a Comment, I'll accept it :) I didn't know about the Shift! @ goldilocks: yes, I knew about shift-ctrl-c, it's not directly related to what I wanted.
    – Ivan Voras
    Mar 2 '15 at 14:05
















  • Not an answer, but you should be able to use xfce4-terminal's own copy/paste from/to vim (shift-ctrl-c, shift-ctrl-v).
    – goldilocks
    Mar 2 '15 at 13:40










  • You know you can hold Shift to get the normal selection right?
    – Stéphane Chazelas
    Mar 2 '15 at 13:41










  • @StéphaneChazelas if you add this as an Answer and not a Comment, I'll accept it :) I didn't know about the Shift! @ goldilocks: yes, I knew about shift-ctrl-c, it's not directly related to what I wanted.
    – Ivan Voras
    Mar 2 '15 at 14:05















Not an answer, but you should be able to use xfce4-terminal's own copy/paste from/to vim (shift-ctrl-c, shift-ctrl-v).
– goldilocks
Mar 2 '15 at 13:40




Not an answer, but you should be able to use xfce4-terminal's own copy/paste from/to vim (shift-ctrl-c, shift-ctrl-v).
– goldilocks
Mar 2 '15 at 13:40












You know you can hold Shift to get the normal selection right?
– Stéphane Chazelas
Mar 2 '15 at 13:41




You know you can hold Shift to get the normal selection right?
– Stéphane Chazelas
Mar 2 '15 at 13:41












@StéphaneChazelas if you add this as an Answer and not a Comment, I'll accept it :) I didn't know about the Shift! @ goldilocks: yes, I knew about shift-ctrl-c, it's not directly related to what I wanted.
– Ivan Voras
Mar 2 '15 at 14:05




@StéphaneChazelas if you add this as an Answer and not a Comment, I'll accept it :) I didn't know about the Shift! @ goldilocks: yes, I knew about shift-ctrl-c, it's not directly related to what I wanted.
– Ivan Voras
Mar 2 '15 at 14:05










1 Answer
1






active

oldest

votes

















up vote
10
down vote



accepted










You can hold the Shift key to use the normal mouse selection while xterm mouse-tracking is enabled. That works in all terminal emulators that I know (xterm, vte (like xfce-terminal) or rxvt-based ones).



In vim specifically, mouse is normally not enabled by default in terminals. So there's probably a set mouse=a somewhere in you ~/.vimrc or your OS-supplied system vimrc. You can always add:



set mouse=


to your ~/.vimrc to disable it. Or:



if !has("gui_running")
set mouse=
endif


to avoid disabling it for the GUI versions of vim.



Mouse support is (sort of) advertised in the terminfo database with the kmous capability. Now, not all applications rely on that to decide whether to enable mouse tracking or not.



You could redefine the entry for your terminal (in a local terminfo database) to remove that capability:



infocmp -1x | grep -v kmous= | TERMINFO=~/.terminfo tic -x -
export TERMINFO=~/.terminfo


For applications using ncurses, it's enough to set the XM user-defined capability (not documented in terminfo(5) but mentioned in curs_caps(5) and curs_mouse(3)) to the empty string. That doesn't prevent the application from handling mouse events if they're sent by the terminal, but that prevents the application from sending the sequence that enters the mouse tracking mode. So you can combine both with:



infocmp -1x |
sed '/kmous=/d;/XM=/d;$s/$/XM=,/' |
TERMINFO=~/.terminfo tic -x -
export TERMINFO=~/.terminfo





share|improve this answer






















  • Are you sure about the terminfo solution? I just tried it on URxvt (with TERM=xterm-256color) but Aptitude is still responding to mouse clicks, which is super annoying. I wished URxvt had an option to disable mouse reporting entirely. I never use it and gets in the way more often than not.
    – Tobia
    Sep 16 at 12:53






  • 1




    @Tobia, see edit.
    – Stéphane Chazelas
    Sep 16 at 13:26






  • 1




    The manual page gives the information (and has, since August 2001).
    – Thomas Dickey
    Sep 16 at 16:00










  • Thanks @ThomasDickey, looks like I also messed up my test cases. See edit.
    – Stéphane Chazelas
    Sep 16 at 18:56










  • If you use the -1 option of infocmp (single column), the sed expression could be simplified.
    – Thomas Dickey
    Sep 16 at 20:46










Your Answer







StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "106"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);

else
createEditor();

);

function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
convertImagesToLinks: false,
noModals: false,
showLowRepImageUploadWarning: true,
reputationToPostImages: null,
bindNavPrevention: true,
postfix: "",
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);



);













 

draft saved


draft discarded


















StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f187695%2fhow-to-disable-mouse-support-in-terminal%23new-answer', 'question_page');

);

Post as a guest






























1 Answer
1






active

oldest

votes








1 Answer
1






active

oldest

votes









active

oldest

votes






active

oldest

votes








up vote
10
down vote



accepted










You can hold the Shift key to use the normal mouse selection while xterm mouse-tracking is enabled. That works in all terminal emulators that I know (xterm, vte (like xfce-terminal) or rxvt-based ones).



In vim specifically, mouse is normally not enabled by default in terminals. So there's probably a set mouse=a somewhere in you ~/.vimrc or your OS-supplied system vimrc. You can always add:



set mouse=


to your ~/.vimrc to disable it. Or:



if !has("gui_running")
set mouse=
endif


to avoid disabling it for the GUI versions of vim.



Mouse support is (sort of) advertised in the terminfo database with the kmous capability. Now, not all applications rely on that to decide whether to enable mouse tracking or not.



You could redefine the entry for your terminal (in a local terminfo database) to remove that capability:



infocmp -1x | grep -v kmous= | TERMINFO=~/.terminfo tic -x -
export TERMINFO=~/.terminfo


For applications using ncurses, it's enough to set the XM user-defined capability (not documented in terminfo(5) but mentioned in curs_caps(5) and curs_mouse(3)) to the empty string. That doesn't prevent the application from handling mouse events if they're sent by the terminal, but that prevents the application from sending the sequence that enters the mouse tracking mode. So you can combine both with:



infocmp -1x |
sed '/kmous=/d;/XM=/d;$s/$/XM=,/' |
TERMINFO=~/.terminfo tic -x -
export TERMINFO=~/.terminfo





share|improve this answer






















  • Are you sure about the terminfo solution? I just tried it on URxvt (with TERM=xterm-256color) but Aptitude is still responding to mouse clicks, which is super annoying. I wished URxvt had an option to disable mouse reporting entirely. I never use it and gets in the way more often than not.
    – Tobia
    Sep 16 at 12:53






  • 1




    @Tobia, see edit.
    – Stéphane Chazelas
    Sep 16 at 13:26






  • 1




    The manual page gives the information (and has, since August 2001).
    – Thomas Dickey
    Sep 16 at 16:00










  • Thanks @ThomasDickey, looks like I also messed up my test cases. See edit.
    – Stéphane Chazelas
    Sep 16 at 18:56










  • If you use the -1 option of infocmp (single column), the sed expression could be simplified.
    – Thomas Dickey
    Sep 16 at 20:46














up vote
10
down vote



accepted










You can hold the Shift key to use the normal mouse selection while xterm mouse-tracking is enabled. That works in all terminal emulators that I know (xterm, vte (like xfce-terminal) or rxvt-based ones).



In vim specifically, mouse is normally not enabled by default in terminals. So there's probably a set mouse=a somewhere in you ~/.vimrc or your OS-supplied system vimrc. You can always add:



set mouse=


to your ~/.vimrc to disable it. Or:



if !has("gui_running")
set mouse=
endif


to avoid disabling it for the GUI versions of vim.



Mouse support is (sort of) advertised in the terminfo database with the kmous capability. Now, not all applications rely on that to decide whether to enable mouse tracking or not.



You could redefine the entry for your terminal (in a local terminfo database) to remove that capability:



infocmp -1x | grep -v kmous= | TERMINFO=~/.terminfo tic -x -
export TERMINFO=~/.terminfo


For applications using ncurses, it's enough to set the XM user-defined capability (not documented in terminfo(5) but mentioned in curs_caps(5) and curs_mouse(3)) to the empty string. That doesn't prevent the application from handling mouse events if they're sent by the terminal, but that prevents the application from sending the sequence that enters the mouse tracking mode. So you can combine both with:



infocmp -1x |
sed '/kmous=/d;/XM=/d;$s/$/XM=,/' |
TERMINFO=~/.terminfo tic -x -
export TERMINFO=~/.terminfo





share|improve this answer






















  • Are you sure about the terminfo solution? I just tried it on URxvt (with TERM=xterm-256color) but Aptitude is still responding to mouse clicks, which is super annoying. I wished URxvt had an option to disable mouse reporting entirely. I never use it and gets in the way more often than not.
    – Tobia
    Sep 16 at 12:53






  • 1




    @Tobia, see edit.
    – Stéphane Chazelas
    Sep 16 at 13:26






  • 1




    The manual page gives the information (and has, since August 2001).
    – Thomas Dickey
    Sep 16 at 16:00










  • Thanks @ThomasDickey, looks like I also messed up my test cases. See edit.
    – Stéphane Chazelas
    Sep 16 at 18:56










  • If you use the -1 option of infocmp (single column), the sed expression could be simplified.
    – Thomas Dickey
    Sep 16 at 20:46












up vote
10
down vote



accepted







up vote
10
down vote



accepted






You can hold the Shift key to use the normal mouse selection while xterm mouse-tracking is enabled. That works in all terminal emulators that I know (xterm, vte (like xfce-terminal) or rxvt-based ones).



In vim specifically, mouse is normally not enabled by default in terminals. So there's probably a set mouse=a somewhere in you ~/.vimrc or your OS-supplied system vimrc. You can always add:



set mouse=


to your ~/.vimrc to disable it. Or:



if !has("gui_running")
set mouse=
endif


to avoid disabling it for the GUI versions of vim.



Mouse support is (sort of) advertised in the terminfo database with the kmous capability. Now, not all applications rely on that to decide whether to enable mouse tracking or not.



You could redefine the entry for your terminal (in a local terminfo database) to remove that capability:



infocmp -1x | grep -v kmous= | TERMINFO=~/.terminfo tic -x -
export TERMINFO=~/.terminfo


For applications using ncurses, it's enough to set the XM user-defined capability (not documented in terminfo(5) but mentioned in curs_caps(5) and curs_mouse(3)) to the empty string. That doesn't prevent the application from handling mouse events if they're sent by the terminal, but that prevents the application from sending the sequence that enters the mouse tracking mode. So you can combine both with:



infocmp -1x |
sed '/kmous=/d;/XM=/d;$s/$/XM=,/' |
TERMINFO=~/.terminfo tic -x -
export TERMINFO=~/.terminfo





share|improve this answer














You can hold the Shift key to use the normal mouse selection while xterm mouse-tracking is enabled. That works in all terminal emulators that I know (xterm, vte (like xfce-terminal) or rxvt-based ones).



In vim specifically, mouse is normally not enabled by default in terminals. So there's probably a set mouse=a somewhere in you ~/.vimrc or your OS-supplied system vimrc. You can always add:



set mouse=


to your ~/.vimrc to disable it. Or:



if !has("gui_running")
set mouse=
endif


to avoid disabling it for the GUI versions of vim.



Mouse support is (sort of) advertised in the terminfo database with the kmous capability. Now, not all applications rely on that to decide whether to enable mouse tracking or not.



You could redefine the entry for your terminal (in a local terminfo database) to remove that capability:



infocmp -1x | grep -v kmous= | TERMINFO=~/.terminfo tic -x -
export TERMINFO=~/.terminfo


For applications using ncurses, it's enough to set the XM user-defined capability (not documented in terminfo(5) but mentioned in curs_caps(5) and curs_mouse(3)) to the empty string. That doesn't prevent the application from handling mouse events if they're sent by the terminal, but that prevents the application from sending the sequence that enters the mouse tracking mode. So you can combine both with:



infocmp -1x |
sed '/kmous=/d;/XM=/d;$s/$/XM=,/' |
TERMINFO=~/.terminfo tic -x -
export TERMINFO=~/.terminfo






share|improve this answer














share|improve this answer



share|improve this answer








edited Sep 16 at 21:47

























answered Mar 2 '15 at 14:38









Stéphane Chazelas

286k53528867




286k53528867











  • Are you sure about the terminfo solution? I just tried it on URxvt (with TERM=xterm-256color) but Aptitude is still responding to mouse clicks, which is super annoying. I wished URxvt had an option to disable mouse reporting entirely. I never use it and gets in the way more often than not.
    – Tobia
    Sep 16 at 12:53






  • 1




    @Tobia, see edit.
    – Stéphane Chazelas
    Sep 16 at 13:26






  • 1




    The manual page gives the information (and has, since August 2001).
    – Thomas Dickey
    Sep 16 at 16:00










  • Thanks @ThomasDickey, looks like I also messed up my test cases. See edit.
    – Stéphane Chazelas
    Sep 16 at 18:56










  • If you use the -1 option of infocmp (single column), the sed expression could be simplified.
    – Thomas Dickey
    Sep 16 at 20:46
















  • Are you sure about the terminfo solution? I just tried it on URxvt (with TERM=xterm-256color) but Aptitude is still responding to mouse clicks, which is super annoying. I wished URxvt had an option to disable mouse reporting entirely. I never use it and gets in the way more often than not.
    – Tobia
    Sep 16 at 12:53






  • 1




    @Tobia, see edit.
    – Stéphane Chazelas
    Sep 16 at 13:26






  • 1




    The manual page gives the information (and has, since August 2001).
    – Thomas Dickey
    Sep 16 at 16:00










  • Thanks @ThomasDickey, looks like I also messed up my test cases. See edit.
    – Stéphane Chazelas
    Sep 16 at 18:56










  • If you use the -1 option of infocmp (single column), the sed expression could be simplified.
    – Thomas Dickey
    Sep 16 at 20:46















Are you sure about the terminfo solution? I just tried it on URxvt (with TERM=xterm-256color) but Aptitude is still responding to mouse clicks, which is super annoying. I wished URxvt had an option to disable mouse reporting entirely. I never use it and gets in the way more often than not.
– Tobia
Sep 16 at 12:53




Are you sure about the terminfo solution? I just tried it on URxvt (with TERM=xterm-256color) but Aptitude is still responding to mouse clicks, which is super annoying. I wished URxvt had an option to disable mouse reporting entirely. I never use it and gets in the way more often than not.
– Tobia
Sep 16 at 12:53




1




1




@Tobia, see edit.
– Stéphane Chazelas
Sep 16 at 13:26




@Tobia, see edit.
– Stéphane Chazelas
Sep 16 at 13:26




1




1




The manual page gives the information (and has, since August 2001).
– Thomas Dickey
Sep 16 at 16:00




The manual page gives the information (and has, since August 2001).
– Thomas Dickey
Sep 16 at 16:00












Thanks @ThomasDickey, looks like I also messed up my test cases. See edit.
– Stéphane Chazelas
Sep 16 at 18:56




Thanks @ThomasDickey, looks like I also messed up my test cases. See edit.
– Stéphane Chazelas
Sep 16 at 18:56












If you use the -1 option of infocmp (single column), the sed expression could be simplified.
– Thomas Dickey
Sep 16 at 20:46




If you use the -1 option of infocmp (single column), the sed expression could be simplified.
– Thomas Dickey
Sep 16 at 20:46

















 

draft saved


draft discarded















































 


draft saved


draft discarded














StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f187695%2fhow-to-disable-mouse-support-in-terminal%23new-answer', 'question_page');

);

Post as a guest













































































Popular posts from this blog

Peggy Mitchell

Palaiologos

The Forum (Inglewood, California)