Loading ...
Sorry, an error occurred while loading the content.

Re: Linux Console with gpm & mouse functionality in Vim

Expand Messages
  • Dominique Pelle
    ... Yes, I experience the same thing. I just tried to test gpm mouse with vim 7.2b.26 BETA on Linux x86 (Ubuntu-8.04). Either I m doing something wrong, or it
    Message 1 of 6 , Aug 3, 2008
    • 0 Attachment
      On Tue, Jul 29, 2008 at 8:56 PM, John Magolske <b79net@...> wrote:

      > * Tony Mechelynck <antoine.mechelynck@...> [080729 09:39]:
      >>
      >> On 25/07/08 07:20, John Magolske wrote:
      >> > While using Vim in a Linux Console, is it possible to use the mouse
      >> > for things like re-positioning the text cursor, selecting text to
      >> > yank, re-sizing windows by dragging the status line, etc.?
      >> >
      >> > The behavior I see is that I can select text by left-clicking and
      >> > dragging, then paste that selection with the middle button. But
      >> > this seems to be independent of Vim, as Vim's text cursor stays put
      >> > while the mouse cursor is moved around, and the selected text is not
      >> > available for yanking.
      >> >
      >> > Also, I find that I cannot re-size windows by dragging or switch focus
      >> > by clicking on another tab. These behaviors are available in an Xterm,
      >> > is it possible to have them in the Linux Console?
      >> >
      >> > This is version 7.1.293 with the +mouse_gpm feature enabled, running
      >> > in Debian unstable. The mouse-related settings in my .vimrc are:
      >> >
      >> > set mouse=a
      >> > set mousemodel=popup_setpos
      >> >
      >> >
      >> > Regards,
      >> >
      >> > John
      >> >
      >> >
      >>
      >> To use the mouse in Vim running in the Linux console, you need:
      >> 1. a version of Vim compiled with +mouse_gpm
      >> 2. the gpm daemon installed and running.
      >>
      >> You already have (1). To see if you have (2), type the following at the
      >> shell prompt:
      >>
      >> ps -lC gpm
      >
      > Thanks for the reply. I have gpm installed, am able to start & stop it
      > with '/etc/init.d/gpm stop' and '/etc/init.d/gpm start', and also
      >
      > ~ % ps -lC gpm
      > F S UID PID PPID C PRI NI ADDR SZ WCHAN TTY TIME CMD
      > 5 S 0 20615 1 0 80 0 - 415 - ? 00:00:00 gpm
      >
      >
      > The version of Vim I'm using has been compiled with +mouse_gpm
      >
      > :version
      > VIM - Vi IMproved 7.1 ... Included patches: 1-293
      > Huge version with GTK2 GUI.
      > ...
      > +mouse +mouseshape +mouse_dec +mouse_gpm -mouse_jsbterm
      > +mouse_netterm +mouse_xterm ...
      >
      >
      > What I'm wondering is, what sort of support is implied here:
      >
      > :help gpm
      > *gpm-mouse*
      > The GPM mouse is only supported when the |+mouse_gpm| feature was
      > enabled at compile time. The GPM mouse driver (Linux console) does
      > not support quadruple clicks.
      >
      > In Insert mode, when a selection is started, Vim goes into Normal
      > mode temporarily. When Visual or Select mode ends, it returns to
      > Insert mode. This is like using CTRL-O in Insert mode. Select mode
      > is used when the 'selectmode' option contains "mouse".
      >
      >
      > The following seems to indicate that only with mswin & xterm terminals
      > can Mouse Control be adjusted:
      >
      > :help behave
      > ...Set behavior for mouse and selection. Valid arguments are:
      > mswin MS-Windows behavior
      > xterm Xterm behavior
      >
      >
      > As far as I can tell, the gpm mouse has no interaction with Vim in the
      > Linux console.
      >
      >
      > Regards,
      >
      > John


      Yes, I experience the same thing. I just tried to test gpm mouse
      with vim 7.2b.26 BETA on Linux x86 (Ubuntu-8.04). Either I'm
      doing something wrong, or it does not work at all. Mouse with
      gpm does not work either when using older vim-7.1.138.

      - gpm is installed (I can use the mouse in text mode when not
      using vim to copy paste text)
      - vim is built with gpm support (+mouse_gpm)
      - my ~/.vimrc contains "set mouse=a"

      Mouse in text mode does not interact with vim. I cannot for example
      use the mouse to resize windows or to move cursor in text mode.
      Shouldn't GPM mouse let me resize windows in text mode or position
      the cursor?

      The mouse only works well when using X (in a xterm or gnome-terminal).

      Does anybody successfully use the mouse with gpm?

      -- Dominique

      --~--~---------~--~----~------------~-------~--~----~
      You received this message from the "vim_use" maillist.
      For more information, visit http://www.vim.org/maillist.php
      -~----------~----~----~----~------~----~------~--~---
    • Markus Heidelberg
      ... I just tried it and it works for me with 7.1.319 and 7.2b.026, huge version. /usr/sbin/gpm -m /dev/input/mice -t imps2 or /usr/sbin/gpm -m /dev/input/mice
      Message 2 of 6 , Aug 3, 2008
      • 0 Attachment
        Dominique Pelle, 03.08.2008:
        >
        > On Tue, Jul 29, 2008 at 8:56 PM, John Magolske <b79net@...> wrote:
        > >
        > > As far as I can tell, the gpm mouse has no interaction with Vim in the
        > > Linux console.
        >
        > The mouse only works well when using X (in a xterm or gnome-terminal).
        >
        > Does anybody successfully use the mouse with gpm?

        I just tried it and it works for me with 7.1.319 and 7.2b.026, huge version.

        /usr/sbin/gpm -m /dev/input/mice -t imps2
        or
        /usr/sbin/gpm -m /dev/input/mice -t ps2

        vim -u NONE
        :set mouse=a

        Now it works: window resizing, visual selection, cursor positioning, ...

        Markus


        --~--~---------~--~----~------------~-------~--~----~
        You received this message from the "vim_use" maillist.
        For more information, visit http://www.vim.org/maillist.php
        -~----------~----~----~----~------~----~------~--~---
      • Tony Mechelynck
        ... WFM: Starting vim in the linux console (e.g. on /dev/tty3, accessed by Ctrl-Alt-F3) then hitting F1 gives two windows, a [No Name] window and a help
        Message 3 of 6 , Aug 3, 2008
        • 0 Attachment
          On 03/08/08 14:57, Dominique Pelle wrote:
          > On Tue, Jul 29, 2008 at 8:56 PM, John Magolske<b79net@...> wrote:
          >
          >> * Tony Mechelynck<antoine.mechelynck@...> [080729 09:39]:
          >>> On 25/07/08 07:20, John Magolske wrote:
          >>>> While using Vim in a Linux Console, is it possible to use the mouse
          >>>> for things like re-positioning the text cursor, selecting text to
          >>>> yank, re-sizing windows by dragging the status line, etc.?
          >>>>
          >>>> The behavior I see is that I can select text by left-clicking and
          >>>> dragging, then paste that selection with the middle button. But
          >>>> this seems to be independent of Vim, as Vim's text cursor stays put
          >>>> while the mouse cursor is moved around, and the selected text is not
          >>>> available for yanking.
          >>>>
          >>>> Also, I find that I cannot re-size windows by dragging or switch focus
          >>>> by clicking on another tab. These behaviors are available in an Xterm,
          >>>> is it possible to have them in the Linux Console?
          >>>>
          >>>> This is version 7.1.293 with the +mouse_gpm feature enabled, running
          >>>> in Debian unstable. The mouse-related settings in my .vimrc are:
          >>>>
          >>>> set mouse=a
          >>>> set mousemodel=popup_setpos
          >>>>
          >>>>
          >>>> Regards,
          >>>>
          >>>> John
          >>>>
          >>>>
          >>> To use the mouse in Vim running in the Linux console, you need:
          >>> 1. a version of Vim compiled with +mouse_gpm
          >>> 2. the gpm daemon installed and running.
          >>>
          >>> You already have (1). To see if you have (2), type the following at the
          >>> shell prompt:
          >>>
          >>> ps -lC gpm
          >> Thanks for the reply. I have gpm installed, am able to start& stop it
          >> with '/etc/init.d/gpm stop' and '/etc/init.d/gpm start', and also
          >>
          >> ~ % ps -lC gpm
          >> F S UID PID PPID C PRI NI ADDR SZ WCHAN TTY TIME CMD
          >> 5 S 0 20615 1 0 80 0 - 415 - ? 00:00:00 gpm
          >>
          >>
          >> The version of Vim I'm using has been compiled with +mouse_gpm
          >>
          >> :version
          >> VIM - Vi IMproved 7.1 ... Included patches: 1-293
          >> Huge version with GTK2 GUI.
          >> ...
          >> +mouse +mouseshape +mouse_dec +mouse_gpm -mouse_jsbterm
          >> +mouse_netterm +mouse_xterm ...
          >>
          >>
          >> What I'm wondering is, what sort of support is implied here:
          >>
          >> :help gpm
          >> *gpm-mouse*
          >> The GPM mouse is only supported when the |+mouse_gpm| feature was
          >> enabled at compile time. The GPM mouse driver (Linux console) does
          >> not support quadruple clicks.
          >>
          >> In Insert mode, when a selection is started, Vim goes into Normal
          >> mode temporarily. When Visual or Select mode ends, it returns to
          >> Insert mode. This is like using CTRL-O in Insert mode. Select mode
          >> is used when the 'selectmode' option contains "mouse".
          >>
          >>
          >> The following seems to indicate that only with mswin& xterm terminals
          >> can Mouse Control be adjusted:
          >>
          >> :help behave
          >> ...Set behavior for mouse and selection. Valid arguments are:
          >> mswin MS-Windows behavior
          >> xterm Xterm behavior
          >>
          >>
          >> As far as I can tell, the gpm mouse has no interaction with Vim in the
          >> Linux console.
          >>
          >>
          >> Regards,
          >>
          >> John
          >
          >
          > Yes, I experience the same thing. I just tried to test gpm mouse
          > with vim 7.2b.26 BETA on Linux x86 (Ubuntu-8.04). Either I'm
          > doing something wrong, or it does not work at all. Mouse with
          > gpm does not work either when using older vim-7.1.138.
          >
          > - gpm is installed (I can use the mouse in text mode when not
          > using vim to copy paste text)
          > - vim is built with gpm support (+mouse_gpm)
          > - my ~/.vimrc contains "set mouse=a"
          >
          > Mouse in text mode does not interact with vim. I cannot for example
          > use the mouse to resize windows or to move cursor in text mode.
          > Shouldn't GPM mouse let me resize windows in text mode or position
          > the cursor?
          >
          > The mouse only works well when using X (in a xterm or gnome-terminal).
          >
          > Does anybody successfully use the mouse with gpm?
          >
          > -- Dominique

          WFM: Starting vim in the linux console (e.g. on /dev/tty3, accessed by
          Ctrl-Alt-F3) then hitting F1 gives two windows, a [No Name] window and a
          help window. So far so good.

          With the settings set by my vimrc, the [No Name] window is reduced to
          only a status line at the far top, with the help window under it. Moving
          the mouse makes the mouse cursor appear; if I move it to the [No Name]
          statusline then drag it downward, the statusline comes down with tildes
          at left of the empty lines above it. The help window is reduced accordingly.

          Clicking the mouse anywhere in a vim window moves the text cursor.

          Dragging the mouse in a vim window creates a -- SELECT -- highlighted area.

          All this in /dev/tty3 (which has no contact with the X server) with gpm
          running and with Vim 7.2b.26. "rpm -qa|grep gpm" answers
          gpm-1.20.1-424.1 on this SuSE 11.0 system. (The same rpm|grep command
          would work on RedHat, which also uses rpm, but not on Debian or Ubuntu,
          which use Debian packages.)

          Dominique, shall I send you my vimrc and/or the stdout/stderr log from
          my latest "make reconfig"? My config options can be seen near the top of
          http://users.skynet.be/antoine.mechelynck/vim/compunix.htm

          Gpm is loaded on this computer (by default) by /etc/init.d/rc5.d/S20gpm
          which is a link to ../gpm (i.e. /etc/init.d/gpm). Shall I send you a
          copy of _that_ script? "which -a gpm" answers (in a root console) with
          /usr/sbin/gpm (and doesn't find anything when non-root).


          Best regards,
          Tony.
          --
          hundred-and-one symptoms of being an internet addict:
          94. Now admit it... How many of you have made "modem noises" into
          the phone just to see if it was possible? :-)

          --~--~---------~--~----~------------~-------~--~----~
          You received this message from the "vim_use" maillist.
          For more information, visit http://www.vim.org/maillist.php
          -~----------~----~----~----~------~----~------~--~---
        • Dominique Pelle
          On Sun, Aug 3, 2008 at 4:39 PM, Tony Mechelynck ... No need to send a ~/.vimrc, it should in theory work with the following simple ~/.vimrc: set nocompatible
          Message 4 of 6 , Aug 3, 2008
          • 0 Attachment
            On Sun, Aug 3, 2008 at 4:39 PM, Tony Mechelynck
            <antoine.mechelynck@...> wrote:

            > WFM: Starting vim in the linux console (e.g. on /dev/tty3, accessed by
            > Ctrl-Alt-F3) then hitting F1 gives two windows, a [No Name] window and a
            > help window. So far so good.
            >
            > With the settings set by my vimrc, the [No Name] window is reduced to
            > only a status line at the far top, with the help window under it. Moving
            > the mouse makes the mouse cursor appear; if I move it to the [No Name]
            > statusline then drag it downward, the statusline comes down with tildes
            > at left of the empty lines above it. The help window is reduced accordingly.
            >
            > Clicking the mouse anywhere in a vim window moves the text cursor.
            >
            > Dragging the mouse in a vim window creates a -- SELECT -- highlighted area.
            >
            > All this in /dev/tty3 (which has no contact with the X server) with gpm
            > running and with Vim 7.2b.26. "rpm -qa|grep gpm" answers
            > gpm-1.20.1-424.1 on this SuSE 11.0 system. (The same rpm|grep command
            > would work on RedHat, which also uses rpm, but not on Debian or Ubuntu,
            > which use Debian packages.)
            >
            > Dominique, shall I send you my vimrc and/or the stdout/stderr log from
            > my latest "make reconfig"? My config options can be seen near the top of
            > http://users.skynet.be/antoine.mechelynck/vim/compunix.htm

            No need to send a ~/.vimrc, it should in theory work with the following
            simple ~/.vimrc:

            set nocompatible
            set mouse=a

            But with above ~/.vimrc, mouse only worked in X, but not with gpm in
            /dev/tty1 (accessed with control alt F1)

            Doing 'ps -efl | grep gpm', I see that gpm is started as:

            /usr/sbin/gpm -m /dev/input/mice -t exps2

            ... which seems OK, since moving the mouse makes the cursor
            show up and I can copy paste text with the mouse in text. But
            somehow Vim does not interact with the mouse. I tried different
            options of gpm (-t ps2, etc) but none of them work.

            AH!, I then found the solution: my ~/.bashrc sets TERM=xterm-color.
            This breaks Vim in text mode (fair enough). After doing "export TERM=linux",
            gpm finally works fine with Vim in text mode.

            -- Dominique

            --~--~---------~--~----~------------~-------~--~----~
            You received this message from the "vim_use" maillist.
            For more information, visit http://www.vim.org/maillist.php
            -~----------~----~----~----~------~----~------~--~---
          • John Magolske
            ... I just tried this simple ~/.vimrc as well, still no luck. ... gpm is started as such on my machine as well. General functionality is present -- I can
            Message 5 of 6 , Aug 3, 2008
            • 0 Attachment
              * Dominique Pelle <dominique.pelle@...> [080803 17:28]:
              >
              > On Sun, Aug 3, 2008 at 4:39 PM, Tony Mechelynck
              > <antoine.mechelynck@...> wrote:
              >
              > > WFM: Starting vim in the linux console (e.g. on /dev/tty3, accessed by
              > > Ctrl-Alt-F3) then hitting F1 gives two windows, a [No Name] window and a
              > > help window. So far so good.
              > >
              > > With the settings set by my vimrc, the [No Name] window is reduced to
              > > only a status line at the far top, with the help window under it. Moving
              > > the mouse makes the mouse cursor appear; if I move it to the [No Name]
              > > statusline then drag it downward, the statusline comes down with tildes
              > > at left of the empty lines above it. The help window is reduced accordingly.
              > >
              > > Clicking the mouse anywhere in a vim window moves the text cursor.
              > >
              > > Dragging the mouse in a vim window creates a -- SELECT -- highlighted area.
              > >
              > > All this in /dev/tty3 (which has no contact with the X server) with gpm
              > > running and with Vim 7.2b.26. "rpm -qa|grep gpm" answers
              > > gpm-1.20.1-424.1 on this SuSE 11.0 system. (The same rpm|grep command
              > > would work on RedHat, which also uses rpm, but not on Debian or Ubuntu,
              > > which use Debian packages.)
              > >
              > > Dominique, shall I send you my vimrc and/or the stdout/stderr log from
              > > my latest "make reconfig"? My config options can be seen near the top of
              > > http://users.skynet.be/antoine.mechelynck/vim/compunix.htm
              >
              > No need to send a ~/.vimrc, it should in theory work with the following
              > simple ~/.vimrc:
              >
              > set nocompatible
              > set mouse=a

              I just tried this simple ~/.vimrc as well, still no luck.

              > But with above ~/.vimrc, mouse only worked in X, but not with gpm in
              > /dev/tty1 (accessed with control alt F1)
              >
              > Doing 'ps -efl | grep gpm', I see that gpm is started as:
              >
              > /usr/sbin/gpm -m /dev/input/mice -t exps2

              gpm is started as such on my machine as well. General functionality
              is present -- I can select with a left-click & drag, and paste with
              a middle-click. But I cannot reposition Vim's text cursor or drag
              status bars. Using the above-mentioned two-line ~/.vimrc or starting
              Vim with 'vim -u NONE' did not improve the situation. This is in a
              Linux framebuffer console (Xwindows not started at all) running in
              GNU Screen. Does gpm work with Vim running in a Screen session in a
              Linux framebuffer console?

              When I quit Screen and run Vim directly in the Linux framebuffer
              console, the left-click & drag stops working. I can move the gpm
              mouse-cursor around, but when I left-click, the mouse-cursor freezes
              and can only be moved again when the left-click is released. Even
              with the above two-line ~/.vimrc, there is this 'frozen mouse cursor'
              behavior. Commenting out 'set mouse=a' will get rid of the frozen
              behavior, as will starting Vim with 'vim -u NONE'. But in both
              instances, there is still no ability to reposition Vim's text cursor
              or drag status bars.

              I also tried renaming the ~/.vim/ directory to make sure the problem
              wasn't being caused by any plugins.

              > AH!, I then found the solution: my ~/.bashrc sets TERM=xterm-color.
              > This breaks Vim in text mode (fair enough). After doing "export
              > TERM=linux", gpm finally works fine with Vim in text mode.

              While in Screen in a Linux framebuffer console:

              % echo $TERM
              screen.linux

              And while in a Linux framebuffer console:

              % echo $TERM
              linux

              When I start Xwindows and run Vim in an Xterm, all the functionality
              is there -- repositioning Vim's text cursor, dragging status bars,
              etc. But not while running Vim in the Linux console. Again, this is
              Vim 7.1, Huge version, compiled with +mouse_gpm, running in Debian.


              John


              --
              John Magolske
              http://B79.net/contact

              --~--~---------~--~----~------------~-------~--~----~
              You received this message from the "vim_use" maillist.
              For more information, visit http://www.vim.org/maillist.php
              -~----------~----~----~----~------~----~------~--~---
            Your message has been successfully submitted and would be delivered to recipients shortly.