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

Re: Vim + ncurses program

Expand Messages
  • Neil Bird
    ... OK, can you do this (it probably won t be pretty!) - amend to make it actually go wrong if I ve missed something! % script vim.out Script started, file is
    Message 1 of 15 , Mar 29, 2001
    • 0 Attachment
      Bohdan Vlasyuk wrote:
      > I've cut all my program, and left only
      > ---------
      > #include <curses.h>
      > int main() {
      > initscr();
      > endwin();
      > return 0;
      > }
      > ~
      > ~
      > ---------
      > an it still appears. when i type :make run (it compiles and runs
      > though make), and then :!ls, is gets wrong -
      > --------
      > main.cpp 2,0-1 All
      > Press RETURN or enter command to continuerdcopy.0 main.cpp messages.pl
      > --------

      OK, can you do this (it probably won't be pretty!) - amend to make it
      actually go wrong if I've missed something!

      % script vim.out
      Script started, file is vim.out
      % vim
      :make run
      :quit
      Script done, file is vim.out


      And then we can have a look at (and even replay with cat?) vim.out


      BTW - what termninal prog. are you using? I can't reproduce this in
      xterm with the above prog. compiled using ncurses (I set makeprg=main -
      does your Makefile do anything for 'run' other than run it?)

      --
      =====================- http://www.thalesgroup.com/ -=====================
      Neil Bird Principal Engineer |
      work - mailto:neil.bird@... | $> cd /pub
      personal - mailto:neil@... | $> more beer
    • Bohdan Vlasyuk
      Hello Neil, Thursday, March 29, 2001, 12:24:22 PM, you wrote: NB OK, can you do this (it probably won t be pretty!) - amend to NB make it actually go wrong
      Message 2 of 15 , Mar 29, 2001
      • 0 Attachment
        Hello Neil,
        Thursday, March 29, 2001, 12:24:22 PM, you wrote:

        NB> OK, can you do this (it probably won't be pretty!) - amend to
        NB> make it actually go wrong if I've missed something!
        NB> And then we can have a look at (and even replay with cat?)
        NB> vim.out
        vim.out attached. however, don't cat it - it screws screen up.

        NB> BTW - what termninal prog. are you using?
        term=linux (i.e. console) :-). however, with yet another one terminal
        program (Irlex) it "works" too.


        --
        Best regards,
        Bohdan mailto:bohdan@...
      • Bram Moolenaar
        ... I ve tried it, but I don t see any problems. I suspect that curses does something to the terminal that confuses Vim. How did you start Vim? In what kind
        Message 3 of 15 , Mar 29, 2001
        • 0 Attachment
          Bohdan Vlasyuk wrote:

          > Sorry, I've formulated it incorrectly - I mean that bugs appear in
          > VIM, and my programs seems to go Ok.
          >
          > I've cut all my program, and left only
          > ---------
          > #include <curses.h>
          > int main() {
          > initscr();
          > endwin();
          > return 0;
          > }
          > ~
          > ~
          > ---------
          > an it still appears. when i type :make run (it compiles and runs
          > though make), and then :!ls, is gets wrong -
          > --------
          > main.cpp 2,0-1 All
          > Press RETURN or enter command to continuerdcopy.0 main.cpp messages.pl
          > --------
          >
          > sometimes when i've pressed Ins, "-- INSERT --" was shifted up one
          > line, etc. It's very unpleasant to work with. Any ideas ??

          I've tried it, but I don't see any problems. I suspect that curses does
          something to the terminal that confuses Vim.

          How did you start Vim? In what kind of terminal are you running this? What
          curses library do you link with? What happens if you run this program in a
          shell and then do "ls"?

          > JS> [2] :!make run *might* also work.
          > Yes, it does. Thanks. If so, the fact that :make run doesn't work is a bug ?

          ":make" redirects its output to a tempfile. Perhaps this confuses curses?

          --
          We apologise again for the fault in the subtitles. Those responsible for
          sacking the people who have just been sacked have been sacked.
          "Monty Python and the Holy Grail" PYTHON (MONTY) PICTURES LTD

          /// Bram Moolenaar -- Bram@... -- http://www.moolenaar.net \\\
          ((( Creator of Vim - http://www.vim.org -- ftp://ftp.vim.org/pub/vim )))
          \\\ Help me helping AIDS orphans in Uganda - http://iccf-holland.org ///
        • Janakiraman .S
          ... (Just in case anyone wants an example of how to reproduce this) I ve had problems with the console, with term=linux too. I ran vim within a screen
          Message 4 of 15 , Mar 29, 2001
          • 0 Attachment
            * Bohdan Vlasyuk (bohdan@...) wrote thusly :

            > NB> BTW - what termninal prog. are you using?
            >
            > term=linux (i.e. console) :-). however, with yet another one terminal
            > program (Irlex) it "works" too.

            (Just in case anyone wants an example of how to reproduce this)

            I've had problems with the console, with term=linux too. I ran vim
            within a screen session and observed tha "-- INSERT --" Weirdness you
            mentioned. Seemed to happen when I had screen show a status line.
            hardstatus alwayslastline "[%d-%M-%Y-%c] --> %w"

            That doesn't happen with screen running in a terminal emulator.
          • Bohdan Vlasyuk
            Hello Janakiraman, ... JS I ve had problems with the console, with term=linux too. I ran vim JS within a screen session and observed tha -- INSERT --
            Message 5 of 15 , Mar 29, 2001
            • 0 Attachment
              Hello Janakiraman,
              Thursday, March 29, 2001, 1:39:45 PM, you wrote:

              >> term=linux
              JS> I've had problems with the console, with term=linux too. I ran vim
              JS> within a screen session and observed tha "-- INSERT --" Weirdness
              JS> you mentioned. Seemed to happen when I had screen show a status
              JS> line. hardstatus alwayslastline "[%d-%M-%Y-%c] --> %w" That
              JS> doesn't happen with screen running in a terminal emulator.
              Yes, my case does not appear in xterm too. By the way, if i do :make
              run from vim running inside screen session, it also appears, but the
              output of my program is warped this time.


              --
              Best regards,
              Bohdan mailto:bohdan@...
            • Neil Bird
              ... That s a good thought. Mind you, I still can t reproduce it (given the noddy curses program you posted before). I ahve to say, though, that I did it with
              Message 6 of 15 , Mar 30, 2001
              • 0 Attachment
                Bohdan Vlasyuk wrote:
                > Well, I do insist in it's being a Vim bug. Reasons:
                > :!make run > temp
                > :!cat temp
                > works Ok.
                >
                > I guess it has something to do with the way Vim parses error file,
                > isn't it ?

                That's a good thought. Mind you, I still can't reproduce it (given the
                noddy curses program you posted before). I ahve to say, though, that I did
                it with 'makeprg=main' after compiling the thing up as main. Does that
                fail for you? I've not tried it through a real Makefile.

                --
                =====================- http://www.thalesgroup.com/ -=====================
                Neil Bird Principal Engineer |
                work - mailto:neil.bird@... | $> cd /pub
                personal - mailto:neil@... | $> more beer
              • Bohdan Vlasyuk
                Hello Neil, Friday, March 30, 2001, 4:05:55 PM, you wrote: NB I have to say, though, that I did it with makeprg=main after NB compiling the thing up as
                Message 7 of 15 , Mar 30, 2001
                • 0 Attachment
                  Hello Neil,
                  Friday, March 30, 2001, 4:05:55 PM, you wrote:

                  NB> I have to say, though, that I did it with 'makeprg=main' after
                  NB> compiling the thing up as main. Does that fail for you? I've not
                  NB> tried it through a real Makefile.
                  No, it does the same as :make run in prev. case.
                  15:06:37 [root,~]$ rpm -q ncurses
                  ncurses-5.0-11

                  To be honest, after this point i've recalled that I still have Vim
                  5.6. As i've downloaded sources some time ago, I've compiled it, and
                  ran :make run again. It worked Ok, so I was ashamed, but decided to
                  dig in sources a bit.. After a while, spent testing, I've noticed that
                  with new settings, variant with makeprg=./log don't work. It appeared
                  that I've occasionally changed run target in makefile to be redirected
                  to `tty`. So, it still "works" in Vim 5.7.

                  the problem is that the output from that "program" is supposed by Vim
                  to be a part of errors by make, and it warps the display, i guess.
                  May be i'm wrong, but the problem do exist. Vim should not care if my
                  program run is correct or not, it must work.

                  There are some possible solutions - or erase '\033's from *err in
                  quickfix.c (line 986), or add to Makefile something like
                  @echo -ne '__VIM-Run start__\r \r'
                  @echo -ne '__VIM-Run end__\r \r'
                  #spaced for it to be invisible to the end-user
                  with regards in quickfix.c or (if possible) in 'errorformat', but it's
                  dirty stuff.

                  So, any ideas ?

                  P.s.: one may detect ncurses by watching for some string like the ones
                  program produce -- in my case it's
                  16:00:41 [root,~/src/vimtest]$ ./log |xxd
                  0000000: 1b5b 313b 3235 721b 5b30 3b31 306d 1b5b .[1;25r.[0;10m.[
                  0000010: 346c 1b5b 3235 3b31 480d 4l.[25;1H.


                  --
                  Best regards,
                  Bohdan mailto:bohdan@...
                Your message has been successfully submitted and would be delivered to recipients shortly.