Problem with ACCEPT in GNU/Linux

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Problem with ACCEPT in GNU/Linux

Marcos Cruz

Hello,

I'm getting a strange effect with ACCEPT in GNU/Linux SP-Forth.

\ --------- Example code:
80 CONSTANT /COMMAND
CREATE COMMAND /COMMAND CHARS ALLOT
.( > ) COMMAND /COMMAND ACCEPT
\ ---------

If first of all I press the Back Space key, nothing happens. That's normal.
But if I type some text and then delete every letter with the Back Space key,
the prompt ("> ") is removed too with the first letter of the text!

It happens with any prompt, any length: it disappears.

In my program I use the following libs, but I think they have nothing to do:

\ ---------
REQUIRE CASE-INS lib/ext/caseins.f  
case-ins on  
require ansi-file lib/include/ansi-file.f  
require key-termios lib/posix/key.f
\ ---------

Is it a problem with the terminal control codes (I use Debian)? Is it a
SP-Forth bug?

спасибо
Marcos

--
http://programandala.net

------------------------------------------------------------------------------
AppSumo Presents a FREE Video for the SourceForge Community by Eric
Ries, the creator of the Lean Startup Methodology on "Lean Startup
Secrets Revealed." This video shows you how to validate your ideas,
optimize your ideas and identify your business strategy.
http://p.sf.net/sfu/appsumosfdev2dev
_______________________________________________
Spf-dev mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/spf-dev
Reply | Threaded
Open this post in threaded view
|

Re: Problem with ACCEPT in GNU/Linux

Ruvim Pinka
On Sun, Jul 17, 2011 at 11:46 PM, Marcos Cruz <[hidden email]> wrote:

Hello,

I'm getting a strange effect with ACCEPT in GNU/Linux SP-Forth.

\ --------- Example code:
80 CONSTANT /COMMAND
CREATE COMMAND /COMMAND CHARS ALLOT
.( > ) COMMAND /COMMAND ACCEPT
\ ---------

If first of all I press the Back Space key, nothing happens. That's normal.
But if I type some text and then delete every letter with the Back Space key,
the prompt ("> ") is removed too with the first letter of the text!


SP-Forth itself does not provide editing of an input line.

ACCEPT just uses READ-LINE for STDIN.

May be devel/~ygrek/lib/linux/readline.f can help you.
Try:
S" devel/~ygrek/lib/linux/readline.f" INCLUDED

--
Ruvim

------------------------------------------------------------------------------
Magic Quadrant for Content-Aware Data Loss Prevention
Research study explores the data loss prevention market. Includes in-depth
analysis on the changes within the DLP market, and the criteria used to
evaluate the strengths and weaknesses of these DLP solutions.
http://www.accelacomm.com/jaw/sfnl/114/51385063/
_______________________________________________
Spf-dev mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/spf-dev