Status Line

parent 65a15bfd
Pipeline #1243 passed with stage
in 11 minutes and 16 seconds
......@@ -405,7 +405,7 @@ FORTH_SRC = $(KERN_SRC) $(GFORTH_FI_DIST_SRC) $(EC_SRC) $(LIBCC_FORTH_SRC) \
unix/%, $(UNIX_SRC)) date.fs script.fs wf.fs traceall.fs rec-scope.fs \
rec-env.fs rec-meta.fs notfound.fs utf16.fs archive.fs cilk.fs \
fixfiles.fs bits.fs reverse-words.fs config.fs set-compsem.fs \
coverage.fs tokenize.fs startup-libcc.fs
coverage.fs tokenize.fs startup-libcc.fs status-line.fs
COMPAT = compat/README \
compat/anslocal.fs \
......
\ status line, inspired by seedForth
\ Authors: Bernd Paysan
\ Copyright (C) 2020 Free Software Foundation, Inc.
\ This file is part of Gforth.
\ Gforth is free software; you can redistribute it and/or
\ modify it under the terms of the GNU General Public License
\ as published by the Free Software Foundation, either version 3
\ of the License, or (at your option) any later version.
\ This program is distributed in the hope that it will be useful,
\ but WITHOUT ANY WARRANTY; without even the implied warranty of
\ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
\ GNU General Public License for more details.
\ You should have received a copy of the GNU General Public License
\ along with this program. If not, see http://www.gnu.org/licenses/.
blue >bg white >fg or bold or Value status-attr
: .status-line ( -- ) { | w^ status$ }
[: ." gforth 😷 | free: " unused u.
." | order: " order
." | base: " base ['] ? #10 base-execute
." | " depth 0= IF ." ∅" ELSE ['] ... #10 base-execute THEN ;]
[: ." gforth 😷 |f " unused u.
." |o " order
." |b " base ['] ? #10 base-execute
." | " depth 0= IF ." ∅" ELSE ['] ... #10 base-execute THEN ;]
cols 100 > select
status$ $exec
cols status$ $@ x-width - dup 0> IF
['] spaces status$ $exec
ELSE 0< IF
0 status$ $@ bounds U+DO
I xc@+ swap >r
dup #tab = IF drop 1+ dfaligned ELSE xc-width + THEN
dup cols u> IF rdrop I status$ $@ drop - status$ $!len
leave THEN
r> I - +LOOP drop
THEN
THEN
.\" \n\n\e[2A\e7"
0 rows 2 - at-xy cols spaces cr
status-attr attr! status$ $. default-color attr!
.\" \e8"
status$ $free ;
' .status-line is .status
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment