Made posix terminal IO avoid spin looping.

Using raw mode + delay in the right places to
allow tasks to work while also supporting key?
This commit is contained in:
Brad Nelson
2024-02-24 12:10:47 -08:00
parent 9468c53ab9
commit eaa8a3c4c3
4 changed files with 39 additions and 9 deletions

View File

@ -458,6 +458,7 @@ e: check-ansi
e: check-tasks
out: start-task
out: task
out: pause?
out: pause
out: tasks
;e
@ -566,13 +567,13 @@ e: test-windows-forth-namespace
e: test-posix-forth-voclist
internals ' sockets voclist-from
out: sockets
out: termios
out: internals
out: graphics
out: ansi
out: editor
out: streams
out: tasks
out: termios
out: posix
out: structures
out: internalized
@ -589,11 +590,11 @@ e: test-posix-forth-namespace
out: telnetd
out: sockets
out: x11
out: form
out: termios
check-desktop
check-filetools
check-phase2
out: form
out: termios
check-allocation
out: ok
out: pwd

View File

@ -28,6 +28,9 @@ forth definitions tasks also internals
task-list @ cell+ @ sp! rp!
;
( Check if there are other tasks. )
: pause? ( -- f ) task-list @ dup @ <> ;
: task ( xt dsz rsz "name" )
create here >r 0 , 0 , ( link, sp )
swap here cell+ r@ cell+ ! cells allot