Compare commits
3 Commits
6d0190c9c0
...
2a685dfcd0
| Author | SHA1 | Date | |
|---|---|---|---|
| 2a685dfcd0 | |||
| f8af7480d3 | |||
| b2c4a90bea |
@@ -172,6 +172,8 @@ https://invisible-island.net/xterm/ctlseqs/ctlseqs.html
|
||||
https://learn.microsoft.com/en-us/windows/console/
|
||||
|
||||
## bugs
|
||||
- If Enter key doesn't work as expected on linux, write `stty sane` to `~/.profile`.
|
||||
It will change terminal settings from insane to sane xD
|
||||
- Double buffering is still new, set ENABLE_DBUF to 0 if you see glitches
|
||||
- Double width characters like 彁 are not fully supported. Terminals do not
|
||||
handle these consistently and there is no portable way to reliably
|
||||
|
||||
@@ -7,10 +7,12 @@ TimState* tim = NULL;
|
||||
static void tim_init(void){
|
||||
tim = (TimState*)malloc(sizeof(TimState));
|
||||
memset(tim, 0, sizeof(TimState));
|
||||
size_t cdb_size = (TIM_MAX_CELLS << TIM_ENABLE_DBUF);
|
||||
tim->cells_double_buf = (TimCell*)malloc(cdb_size * sizeof(TimCell));
|
||||
size_t cdb_size = (TIM_MAX_CELLS << TIM_ENABLE_DBUF) * sizeof(TimCell);
|
||||
tim->cells_double_buf = (TimCell*)malloc(cdb_size);
|
||||
memset(tim->cells_double_buf, 0, cdb_size);
|
||||
tim->cells = tim->cells_double_buf;
|
||||
tim->buf = (char*)malloc(TIM_MAX_BUF);
|
||||
memset(tim->buf, 0, TIM_MAX_BUF);
|
||||
}
|
||||
|
||||
static void tim_deinit(void){
|
||||
|
||||
@@ -65,6 +65,7 @@ void tim_reset_terminal(void) {
|
||||
tcsetattr(STDOUT_FILENO, TCSADRAIN, &tim->attr); // restore attributes
|
||||
tim_write_str(S("\33[?1000l")); // disable mouse
|
||||
tim_write_str(S("\33[?1002l")); // disable mouse
|
||||
tim_write_str(S("\33[?1006l")); // disable mouse
|
||||
tim_write_str(S("\33[m")); // reset colors
|
||||
tim_write_str(S("\33[?25h")); // show cursor
|
||||
tim_write_str(S("\33[?1049l")); // exit alternate buffer
|
||||
|
||||
Reference in New Issue
Block a user