Linux console mouse support

Any terminal shell with mouse support?

Is there any terminal shell/emulator out there that supports editing your current command with the mouse? Specifically things like placing the cursor by clicking (useful for long commands) or double clicking and pressing delete to select and delete a word etc. For example, the terminal at the bottom of Midnight Commander (mc) has support for placing the cursor by mouse click. I’m looking for something similar that is more terminal-focused, as mc is mainly a file manager. It’s fine if it only works under a GUI environment (I’m on Ubuntu 18.04 with GNOME3).

Midnight Commander is as much a terminal application as any other, and what you are looking for is shells, that understand mouse input because their ZLE/libedit/Readline libraries do. The terminal emulators have provided mouse input capabilities for years. What you are looking for is shells that enable and understand such input.

I could also imagine a terminal emulator (use whatever word) that would fully work like a normal GUI application, say like MATLAB, where you can properly edit your command in the modern way with a thin line cursor, right click menus etc., then press enter and then the whole line would be given to bash as one command. However I can see how this would be problematic for interactive terminal applications. I’m just brainstorming because I find the current ways quite inconvenient.

That wouldn’t work, ironically because the ZLE/libedit/Readline libraries would get in the way. In the POSIX General Terminal Interface architecture, editing is either a function of the applications softwares themselves (such as shells with ZLE/libedit/Readline) or of the line discipline when in canonical mode. Terminals are not block mode and there is no local editing. What you are looking for is shells where the editor library knows about mouse reports.

Читайте также:  Linux version code include

Источник

Как настроить поддержку мыши для виртуальных консолей Linux

Я использую Oracle VirtualBox для тестирования различных Unix-подобных операционных систем.

Большинство моих виртуальных машин – это серверы, которые не имеют графической среды рабочего стола.

В течение долгого времени мне было интересно, как мы можем использовать мышь в текстовых терминалах на Linux-серверах.

Благодаря GPM, сегодня я узнал, что мы можем использовать мышь в виртуальных консолях для операций копирования и вставки.

GPM, аббревиатура для General Purpose Mouse, является демоном, который помогает вам настраивать поддержку мыши для виртуальных консолей Linux.

Пожалуйста, не путайте GPM с GDM (диспетчер отображения GNOME).

Оба служат для совершенно разных целей.

GPM особенно полезен в следующих случаях:

  • Linux-сервера, которые по умолчанию не могут или не используют систему X-окон, например Arch Linux и Gentoo.
  • Использование операций copy / paste в виртуальных терминалах / консолях.
  • Использование copy / paste в текстовых редакторах и браузерах (например, emacs, lynx).
  • Использование copy / paste в менеджерах текстовых файлов (например, Ranger, Midnight commander).

В этом кратком руководстве мы рассмотрим, как использовать мышь в текстовых терминалах в Unix-подобных операционных системах.

Установка GPM

Чтобы включить поддержку мыши в текстовых системах Linux, установите пакет GPM.

Он доступен в репозиториях по умолчанию для большинства дистрибутивов Linux.

В Arch Linux и его вариантах, таких как Antergos, Manjaro Linux, выполните следующую команду для установки GPM:

На Debian, Ubuntu, Linux Mint:

После установки включите и запустите службу GPM, используя следующие команды:

$ sudo systemctl enable gpm

В системах на базе Debian служба gpm автоматически запускается после ее установки, поэтому вам не нужно вручную запускать службу, как показано выше.

Настройка поддержки мыши для виртуальных консолей Linux

Специальной конфигурации не требуется.

GPM начнет работать, как только вы его установили, и запустите службу gpm.

Посмотрите на следующий снимок экрана моего сервера Ubuntu 18.04 LTS перед установкой GPM:

Как видно из приведенного выше скриншота, на моем Ubuntu 18.04 LTS-сервере нет видимого указателя мыши.

Только мигающий курсор, и он не позволит мне выбрать текст, скопировать / вставить текст с помощью мыши.

В серверах Linux, ориентированных только на CLI, мышь буквально не приносит пользы.

Теперь проверьте следующий снимок экрана сервера Ubuntu 18.04 LTS после установки GPM:

Читайте также:  Посмотреть активные порты linux

Чтобы выбрать, скопировать и вставить текст, выполните следующие действия:

Чтобы выбрать текст, нажмите левую кнопку мыши и перетащите мышь.
После того, как вы выбрали текст, отпустите левую кнопку мыши и вставьте текст в ту же самую или другую консоль, нажав среднюю кнопку мыши.
Правая кнопка используется для расширения выделения, например, в `xterm ‘.
Если вы используете двухкнопочную мышь, используйте правую кнопку для вставки текста.

Как я уже сказал, GPM работает отлично, и нет необходимости в дополнительной настройке.

Вот пример содержимого конфигурационного файла GPM /etc/gpm.conf (или /etc/conf.d/gpm в некоторых дистрибутивах):

# protected from evaluation (i.e. by quoting them). # # This file is used by /etc/init.d/gpm and can be modified by # "dpkg-reconfigure gpm" or by hand at your option. # device=/dev/input/mice responsiveness= repeat_type=none type=exps2 append='' sample_rate=

В моем примере я использую USB-мышь.

Если вы используете другую мышь, вам может потребоваться изменить значения параметров device = / dev / input / mice и type = exps2.

Для получения дополнительной информации см. Справочные страницы.

Источник

Activate mouse in Linux console (terminal)

Default featured post

In regular Terminal application in GUI you can use mouse to copy/paste via mouse wheel or sometimes even you can click depends on the application you run.

But in Linux console or simply in full text-mode by default mouse is not active and it has no use. If you want to active mouse in Linux text-mode you need to install gpm package which activates mouse in text-mode.

Here is the installation command of gpm in Ubuntu Linux.

Remember that after installation you need to reboot you computer/laptop to activate your mouse.

Enjoy having mouse in text-mode.

Share this:

You might also like

Default featured post

Few hints regarding Arch Linux configurations for beginners

Default featured post

Printing characters before/after a certain pattern in a file in Linux

Default featured post

How to add public key in apt-get

Follow Geeky Hacker

The technical storage or access is strictly necessary for the legitimate purpose of enabling the use of a specific service explicitly requested by the subscriber or user, or for the sole purpose of carrying out the transmission of a communication over an electronic communications network.

The technical storage or access is necessary for the legitimate purpose of storing preferences that are not requested by the subscriber or user.

The technical storage or access that is used exclusively for statistical purposes. The technical storage or access that is used exclusively for anonymous statistical purposes. Without a subpoena, voluntary compliance on the part of your Internet Service Provider, or additional records from a third party, information stored or retrieved for this purpose alone cannot usually be used to identify you.

Читайте также:  Ubuntu linux with windows

The technical storage or access is required to create user profiles to send advertising, or to track the user on a website or across several websites for similar marketing purposes.

Источник

Activate mouse in Linux console (terminal)

Default featured post

In regular Terminal application in GUI you can use mouse to copy/paste via mouse wheel or sometimes even you can click depends on the application you run.

But in Linux console or simply in full text-mode by default mouse is not active and it has no use. If you want to active mouse in Linux text-mode you need to install gpm package which activates mouse in text-mode.

Here is the installation command of gpm in Ubuntu Linux.

Remember that after installation you need to reboot you computer/laptop to activate your mouse.

Enjoy having mouse in text-mode.

Share this:

You might also like

Default featured post

Few hints regarding Arch Linux configurations for beginners

Default featured post

Printing characters before/after a certain pattern in a file in Linux

Default featured post

How to add public key in apt-get

Follow Geeky Hacker

The technical storage or access is strictly necessary for the legitimate purpose of enabling the use of a specific service explicitly requested by the subscriber or user, or for the sole purpose of carrying out the transmission of a communication over an electronic communications network.

The technical storage or access is necessary for the legitimate purpose of storing preferences that are not requested by the subscriber or user.

The technical storage or access that is used exclusively for statistical purposes. The technical storage or access that is used exclusively for anonymous statistical purposes. Without a subpoena, voluntary compliance on the part of your Internet Service Provider, or additional records from a third party, information stored or retrieved for this purpose alone cannot usually be used to identify you.

The technical storage or access is required to create user profiles to send advertising, or to track the user on a website or across several websites for similar marketing purposes.

Источник

Оцените статью
Adblock
detector