listener: don't activate the ctrl-break handler by default

To activate the ctrl-break handler, add the following code to your
.factor-rc:
USING: listener namespaces ; t handle-ctrl-break set-global
char-rename
Alexander Iljin 2016-08-24 03:27:07 +03:00 committed by John Benediktsson
parent 17aa171ccf
commit 82c1a1e936
1 changed files with 9 additions and 1 deletions

View File

@ -24,8 +24,16 @@ H{
M: object prompt.
nip prompt-style get-global format bl flush ;
SYMBOL: handle-ctrl-break
: maybe-enable-ctrl-break ( -- )
handle-ctrl-break get-global [ enable-ctrl-break ] when ;
: with-ctrl-break ( quot -- )
enable-ctrl-break
maybe-enable-ctrl-break
! Always call disable-ctrl-break, no matter what handle-ctrl-break
! says: it might've been changed just now by the user in the Listener.
! It's a no-op if it's not enabled.
[ disable-ctrl-break ] [ ] cleanup ; inline
: parse-lines-interactive ( lines -- quot/f )