diff options
Diffstat (limited to 'src/display/term.nim')
-rw-r--r-- | src/display/term.nim | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/src/display/term.nim b/src/display/term.nim index cbfa07ca..57ee2213 100644 --- a/src/display/term.nim +++ b/src/display/term.nim @@ -66,10 +66,6 @@ type orig_flags2: cint orig_termios: Termios -func hascap(term: Terminal, c: TermcapCap): bool = term.tc.caps[c] != nil -func cap(term: Terminal, c: TermcapCap): string = $term.tc.caps[c] -func ccap(term: Terminal, c: TermcapCap): cstring = term.tc.caps[c] - # control sequence introducer template CSI(s: varargs[string, `$`]): string = "\e[" & s.join(';') @@ -96,6 +92,14 @@ when not termcap_found: CSI() & "K" template ED(): string = CSI() & "J" +else: + func hascap(term: Terminal, c: TermcapCap): bool = term.tc.caps[c] != nil + func cap(term: Terminal, c: TermcapCap): string = $term.tc.caps[c] + func ccap(term: Terminal, c: TermcapCap): cstring = term.tc.caps[c] + + var goutfile: File + proc putc(c: char): cint {.cdecl.} = + goutfile.write(c) template SGR*(s: varargs[string, `$`]): string = CSI(s) & "m" @@ -111,10 +115,6 @@ const ANSIColorMap = [ ColorsRGB["white"], ] -var goutfile: File -proc putc(c: char): cint {.cdecl.} = - goutfile.write(c) - proc write(term: Terminal, s: string) = when termcap_found: discard tputs(cstring(s), cint(s.len), putc) |