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

Re: Fetching a single character of input

Expand Messages
  • Neil Bird
    ... Erm ... Yes, sorry, I managed to miss that :-/ OK, well I m pretty well there: two snags (ref. attached test
    Message 1 of 6 , Feb 2, 2001
    • 0 Attachment
      Bram Moolenaar wrote:
      > > Actually, what I'm thinking of is being able to 'print' xterm query
      > > codes and have some way of extracting the answer in a vim function.
      >
      > Is getchar() not sufficient?

      Erm ... <fx: whistles and looks around innocently>

      Yes, sorry, I managed to miss that :-/


      OK, well I'm pretty well there: two snags (ref. attached test script)

      (1) is there a way to force echo to actually /print/ an <esc> as opposed
      to "^["? Yes, I know it'd normally be dangerous, but doing !echo switches
      screens.

      (2) getchar(), as far as I can tell, is actually waiting for me to
      physically type something before it sees the xterm's response (which it
      does do). I.e., I run the attached GetSize() and have to hit <Space> to
      get anything.

      --
      =====================- http://www.thalesgroup.com/ -=====================
      Neil Bird | If this .signature |
      work mailto:neil.bird@... | looks pants, then | $> cd /pub
      personal mailto:neil@... | stop using Outlook! | $> more beer
    • Bram Moolenaar
      ... Did you try adding to isprint ? ... It works fine for me, without typing a space. Perhaps it s because your xterm swaps screens? Anyway, getchar()
      Message 2 of 6 , Feb 2, 2001
      • 0 Attachment
        Neil Bird wrote:

        > (1) is there a way to force echo to actually /print/ an <esc> as opposed
        > to "^["? Yes, I know it'd normally be dangerous, but doing !echo switches
        > screens.

        Did you try adding <Esc> to 'isprint'?

        > (2) getchar(), as far as I can tell, is actually waiting for me to
        > physically type something before it sees the xterm's response (which it
        > does do). I.e., I run the attached GetSize() and have to hit <Space> to
        > get anything.

        It works fine for me, without typing a space. Perhaps it's because your xterm
        swaps screens?

        Anyway, getchar() wasn't really setup to handle communication with escape
        sequences. I'm surprised this actually works.

        --
        hundred-and-one symptoms of being an internet addict:
        126. You brag to all of your friends about your date Saturday night...but
        you don't tell them it was only in a chat room.

        /// 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 ///
      • Neil Bird
        ... So many vim help files, so little time :-) ... Good golly - it works. Time to give yourself a[nother] big pat on the back, then. Having set
        Message 3 of 6 , Feb 2, 2001
        • 0 Attachment
          Bram Moolenaar wrote:
          > Did you try adding <Esc> to 'isprint'?

          <sigh> So many vim help files, so little time :-)


          > It works fine for me, without typing a space. Perhaps it's because your xterm
          > swaps screens?
          >
          > Anyway, getchar() wasn't really setup to handle communication with escape
          > sequences. I'm surprised this actually works.

          Good golly - it works. Time to give yourself a[nother] big pat on the
          back, then. Having set isprint+=27 within the script, it works a treat.
          The problems were wholly to do with the codes going to/from different
          alternate screens.

          Now I can do all /manner/ of clever xterm-y things from vim :-)

          --
          =====================- http://www.thalesgroup.com/ -=====================
          Neil Bird | If this .signature |
          work mailto:neil.bird@... | looks pants, then | $> cd /pub
          personal mailto:neil@... | stop using Outlook! | $> more beer
        • Bram Moolenaar
          ... Oh, Oh! :-) -- In a world without fences, who needs Gates and Windows? /// Bram Moolenaar -- Bram@moolenaar.net -- http://www.moolenaar.net (((
          Message 4 of 6 , Feb 2, 2001
          • 0 Attachment
            Neil Bird wrote:

            > Good golly - it works. Time to give yourself a[nother] big pat on the
            > back, then. Having set isprint+=27 within the script, it works a treat.
            > The problems were wholly to do with the codes going to/from different
            > alternate screens.
            >
            > Now I can do all /manner/ of clever xterm-y things from vim :-)

            Oh, Oh! :-)

            --
            In a world without fences, who needs Gates and Windows?

            /// 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 ///
          Your message has been successfully submitted and would be delivered to recipients shortly.