[SOLVED] How to Enable MC mouse support while using screen?

Recommended Posts


Solution added to first post - thanks to Beckp & Spectrum


Problem: Lack of mouse support in putty using screen (especially usefully for midnight commander)

Solution: Instead of invoking screen by just typing: 'screen'  use: 'screen -T xterm'

            Then when you type 'mc' to run midnight commander mouse support works great!  Very useful!




When using putty to telnet into my unraid box - if I run midnight commander (mc), I have full mouse support.  If I run screen first, then run mc, mouse support is lost.


Can anyone tell me how to fix this - how to make mc mouse support work when mc is launched after screen?


I searched around and found this info elsewhere:

I've found that this problem can be fixed by adding a line like this to your .screenrc: 
termcapinfo linux|xterm|rxvt|xterm-color [email protected]:[email protected]:XT 
The XT part tells screen that the 'real' terminal understands XTerm specific stuff like mouse reporting. 
This works for me with PuTTY on Windows connected to Ubuntu GNU/Linux using the "linux" style terminal. 
Note that you can override the application's use of the mouse by holding down shift, assuming the appropriate PuTTY option is checked. This is useful when e.g. copying some text out of a console Emacs session into a Window application. 



I gave it a shot by doing the following:

I found the .screenrc in /etc/skel   and copied it to my /home directory

(I also tried adding the line to the version in /etc)

I then edited the file by adding: termcapinfo linux|xterm|rxvt|xterm-color [email protected]:[email protected]:XT

no joy.


I'm not sure if my new config file is even being loaded by the screen setup installed by the unmenu package manager.  Also not sure if the added line still applies to the version of screen i'm using...

Obviously, i'm pushing at the limits (past them) of my nix knowledge.  ANY HELP would be appreciated!


Link to comment

Do other people use the mouse with midnight commander (thru a putty terminal) - does mouse support drop out when you run screen, then load midnight commander?


(Should have asked this first i guess)


I would appreciate any responses confirming/not so I know if it is just my setup or a general issue.



Link to comment

Screen defaults to vt100 terminal emulation and it looks like mc doesn't enable the mouse with that terminal.  After you run screen and before you run mc you could execute

export TERM=xterm

That lets the mouse work in screen from a putty session.

You may be able to make it persistent with a setting in the .screenrc file, but it's not something I've looked into....

Link to comment

That worked - BOTH Methods!  The mouse is actually working in midnight commander thru screen now!  Thank you very much.  



Solution 1: (Spectrum)

type: screen

type: export TERM=xterm

then: mc


The export command allows mouse support in the putty terminal.


Solution 2: (Beckp) Seems to combine this into the screen command, so just start screen by

type: screen -T xterm

then: mc


It is so easy just to do one of the above, I have not tried to integrate it into a .screenrc file either.

Thank you both!

Link to comment
  • 9 years later...

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.