diff --git a/ueforth/common/boot.fs b/ueforth/common/boot.fs index 547c84d..cbeb027 100644 --- a/ueforth/common/boot.fs +++ b/ueforth/common/boot.fs @@ -197,5 +197,6 @@ create input-buffer input-limit allot #tib ! 'tib ! 0 >in ! evaluate-buffer r> >in ! r> #tib ! r> 'tib ! ; : query begin ['] evaluate-buffer catch - if ." ERROR" cr then prompt refill drop again ; + if 0 state ! sp0 sp! rp0 rp! ." ERROR" cr then + prompt refill drop again ; : ok ." uEForth" cr prompt refill drop query ; diff --git a/ueforth/common/terminal.fs b/ueforth/common/terminal.fs index afcebf7..17d0b8a 100644 --- a/ueforth/common/terminal.fs +++ b/ueforth/common/terminal.fs @@ -1,6 +1,6 @@ ( Terminal handling ) : n. ( n -- ) base @ swap decimal <# #s #> type base ! ; -: esc 27 emit ; +: esc 27 emit ; : bel 7 emit ; : at-xy ( x y -- ) esc ." [" 1+ n. ." ;" 1+ n. ." H" ; : page esc ." [2J" esc ." [H" ; : normal esc ." [0m" ; diff --git a/ueforth/windows/windows.fs b/ueforth/windows/windows.fs index e01d867..441e4da 100644 --- a/ueforth/windows/windows.fs +++ b/ueforth/windows/windows.fs @@ -65,3 +65,5 @@ stdout console-mode @ ENABLE_VIRTUAL_TERMINAL_PROCESSING or SetConsoleMode drop : win-bye ( -- ) 0 ExitProcess drop ; ' win-bye is bye +: set-title ( a n -- ) esc ." ]0;" type bel ; +s" uEforth" set-title