1
0
mirror of https://github.com/vlang/v.git synced 2023-08-10 21:13:21 +03:00

term.ui: approximate colors into ansi if rgb isn't supported (#6951)

This commit is contained in:
spaceface777
2020-11-26 00:28:57 +01:00
committed by GitHub
parent 258f8f6af9
commit e03ae19372
7 changed files with 215 additions and 34 deletions

View File

@ -1,3 +1,6 @@
// Copyright (c) 2020 Raúl Hernández. All rights reserved.
// Use of this source code is governed by an MIT license
// that can be found in the LICENSE file.
module ui
const (
@ -28,12 +31,12 @@ pub fn (mut ctx Context) load_title() {
print('\x1b[23;0t')
}
pub fn (mut ctx Context) run() {
pub fn (mut ctx Context) run() ? {
if ctx.cfg.use_x11 {
ctx.fail('error: x11 backend not implemented yet')
exit(1)
} else {
ctx.termios_setup()
ctx.termios_setup()?
ctx.termios_loop()
}
}