From: bradb
Subject: Small problems with cl-ncurses
Date: 
Message-ID: <1128235593.618886.180820@o13g2000cwo.googlegroups.com>
Hi all, I am playing with cl-ncurses and so far I am having a few
issues with input.
Basically I set (cbreak) mode, which means that (I think) each char
should come through raw to me, without needing an enter.  Man page here
http://www.delorie.com/gnu/docs/ncurses/man/curs_inopts.3x.html

However, this simple program - which should
1) Clear the terminal & print a
2) Wait for a char, but do no echoing
3) Print b
4) wait for a char and exit

(asdf:operate 'asdf:load-op 'cl-ncurses)
(in-package :cl-ncurses) ; needed in SBCL, not for CMUCL
(defun start ()
  (initscr)
  (erase)
  (cbreak)
  (noecho)
  (refresh)
  (addch (char-code #\a))
  (refresh)
  (getch)
  (addch (char-code #\b))
  (refresh)
  (getch)
  (print "after rl")
  (nocbreak)
  (echo)
  (endwin))

(start)

Doesn't behave as expected.  The getch accepts multiple chars until
return is pressed.  Am I doing something very wrong?  Is the Lisp shell
mucking me up?

Thanks
Brad

From: bradb
Subject: Re: Small problems with cl-ncurses
Date: 
Message-ID: <1128236603.635960.273620@o13g2000cwo.googlegroups.com>
The following C program from an Xterm behaves as expected

#include <curses.h>
#include <signal.h>

int main(int argc, char *argv[])
{
    /* initialize your non-curses data structures here */

    (void) initscr();      /* initialize the curses library */
    //keypad(stdscr, TRUE);  /* enable keyboard mapping */
    //(void) nonl();         /* tell curses not to do NL->CR/NL on
output */
    (void) cbreak();       /* take input chars one at a time, no wait
for \n */
    (void) noecho();         /* echo input - in color */
    addch('a');
    getch();     /* refresh, accept single keystroke of input */
    addch('b');
    getch();     /* refresh, accept single keystroke of input */
    endwin ();
}
From: Julian Squires
Subject: Re: Small problems with cl-ncurses
Date: 
Message-ID: <_t2dncdM9P1nfqLeRVn-rA@rogers.com>
On 2005-10-02, bradb <··············@gmail.com> wrote:
> Doesn't behave as expected.  The getch accepts multiple chars until
> return is pressed.  Am I doing something very wrong?  Is the Lisp shell
> mucking me up?

Works for me.  You're not using SLIME or linedit or anything with it,
are you?

-- 
Julian Squires
From: bradb
Subject: Re: Small problems with cl-ncurses
Date: 
Message-ID: <1128270181.226649.88810@g14g2000cwa.googlegroups.com>
I am using Vllisp - and it turns out that is what is mucking me up.  I
suspect that funnel.pl (which funnels standard input & .lisp-pipe
together) is the problem.  Maybe I can fix it there... Wish I knew Perl
right about now....

Thanks
Brad
From: bradb
Subject: Re: Small problems with cl-ncurses
Date: 
Message-ID: <1128312558.279099.283700@g43g2000cwa.googlegroups.com>
I posted this to the ncurses devel list - but thought that it couldn't
hurt to throw it here also.

Hi all, I am trying to use the getyx macro, and get the error
; Warning: This function is undefined:
;   WRAP-GETYX
; Error in KERNEL:%COERCE-TO-FUNCTION:  the function WRAP-GETYX is
undefined.

My program does basically ...
(asdf:operate 'asdf:load-op 'cl-ncurses)
(in-package :cl-ncurses)
    (let (x y)
          (getyx stdscr y x)
          (mvaddstr 20 0 (format nil "~a ~a" x y)))

I am new to Lisp in general, so I don't really know how to go about
fixing this...
Any help is much appreciated.

Thanks
Brad
From: bradb
Subject: Re: Small problems with cl-ncurses
Date: 
Message-ID: <1128318545.235860.222690@z14g2000cwz.googlegroups.com>
I'm replying here because the post to ncurses-devel hasn't come to my
mail box yet.  Anyhow - I have somehow managed to hack up my system so
that cl-ncurses:getyx works.

The problem appears to be in the asdf packaging
1) The glue.so file isn't being "linked"
2) The glue.lisp file isn't being loaded

I don't know how to fix this myself, but hopefully someone can look
into this & not waste too much time getting to the root of the problem.
 Not that an experienced Lisper would take so long to find the issue :)

Brad