About nixCraft

Topics

Howto: Linux configure the Mouse at a text based terminal for copy and paste operation

Posted by Vivek Gite [Last updated: September 13, 2006]

When you come from GUI to text-based terminal, you might miss the cut and past mouse functionality.

You can use your mouse to copy and paste at a terminal. Install gpm which is a cut and paste utility and mouse server for virtual consoles.

What is gpm?

'gpm' provides mouse support to text-based Linux applications like the Emacs editor and the Midnight Commander file management system. Gpm also provides console cut-and-paste operations using the mouse and includes a program to allow pop-up menus to appear at the click of a mouse button.

From the man page, "This package tries to be a useful mouse server for applications running on the Linux console. It is based on the "selection" package, and some of its code comes from selection itself. This package is intended as a replacement for "selection" as a cut-and-paste mechanism; it also provides additional facilities. The "selection" package offered the first cut-and-paste implementation for Linux using two mouse buttons, and the cut buffer is still called "selection buffer" or just "selection" throughout this document. The information below is extracted from the texinfo file, which is the preferred source of information."

Install gpm

If you are using Debian Linux, type the command:
# apt-get install gpm

If you are using Ubuntu Linux, type the command:
$ sudo apt-get install gpm

If you are using Red Hat Enterprise Linux, type the command:
# up2date gpm

If you are using Fedora Core Linux, type the command:
# yum install gpm

Task: Select text (copy text)

To select text press the left mouse button and drag the mouse.

Task: Paste text

To paste text in the same or another console, press the middle button. The right button is used to extend the selection, like in 'xterm'.

Task: Start/stop mouse service

# /etc/init.d/gpm stop | start
OR
$ sudo /etc/init.d/gpm stop | start

Please note that two-button mice use the right button to paste text.

Read man page of gpm for more information. See how to configure mouse under FreeBSD for same purpose.

Tell us how we're doing: Please answer a few questions about your experience to help us improve nixCraft.

You may also be interested in other helpful articles:

Leave a Reply

We encourage your comments, and suggestions. But please stay on topic, be polite, and avoid spam. Thank you very much for stopping by our site!

XHTML: You can use these tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

*
To prove you're a person (not a spam script), type the security word shown in the picture. Click on the picture to hear an audio file of the word.
Click to hear an audio file of the anti-spam word

Copyright © 2004-2008 nixCraft. All rights reserved - TOS/Disclaimer - Privacy policy - Sitemap - Powered by Open source software.