         [ ffi:cbreak ] [ ffi:nocbreak ] if
     ] if curses-error ;
 
-: apply-options ( window -- )
+: apply-window-options ( window -- )
     {
-        [ [ cbreak>> ] [ raw>> ] bi set-cbreak/raw ]
-        [ echo>> [ ffi:echo ] [ ffi:noecho ] if curses-error ]
         [ [ ptr>> ] [ scrollok>> >BOOLEAN ] bi ffi:scrollok curses-error ]
         [ [ ptr>> ] [ leaveok>> >BOOLEAN ] bi ffi:leaveok curses-error ]
         [ [ ptr>> ] [ keypad>> >BOOLEAN ] bi ffi:keypad curses-error ]
     } cleave ;
+
+: apply-global-options ( window -- )
+    [ [ cbreak>> ] [ raw>> ] bi set-cbreak/raw ]
+    [ echo>> [ ffi:echo ] [ ffi:noecho ] if curses-error ]
+    bi ;
 
 SYMBOL: n-registered-colors
 

        init-terminal
        ffi:initscr curses-pointer-error drop
        dup ptr>> ffi:set_term curses-pointer-error drop
    ] dip apply-options ;
    
<PRIVATE


    [
        '[
            ffi:initscr curses-pointer-error
            >>ptr
            [ apply-global-options ] [ apply-window-options ] [ ] tri

            ffi:erase curses-error
            init-colors

            _ with-window
        ] [ ffi:endwin curses-error ] [ ] cleanup
    ] with-destructors ; inline
