fixed merge conflix

This commit is contained in:
2025-06-06 11:13:21 -07:00
4 changed files with 98 additions and 69 deletions

View File

@@ -99,9 +99,11 @@ struct tart_cell tart_set_cell(struct tart_buffer* buffer, struct tart_cell cell
tart_byte tart_draw_window(struct tart_window * window, char* rend_buffer) {
int offset = 0;
int i = 0;
int bufferWidth = 0;
for (int b = 0;b < 0xFF; b++) {
if(window->buffers[b].cell_count == 0)
continue;
bufferWidth = window->buffers[b].size.x;
for (int y = 0; y < window->buffers[b].size.y; y++) {
for (int x = 0; x < window->buffers[b].size.x; x++) {
// add data to window c buffer.
@@ -110,14 +112,13 @@ tart_byte tart_draw_window(struct tart_window * window, char* rend_buffer) {
// puts cell drawing data in pre
int size = sprintf(pre, "\033[%d;%d;%dm%c\033[0;0m",
(int)cell.style, cell.foreground,
cell.background, cell.display);
cell.background, cell.display) -1;
for(int preIdx = 0; preIdx < size; preIdx++) {
window->data[(y*window->buffers[b].size.x) + x + offset] = pre[preIdx];
offset++;
}
}
window->data[((y)*window->buffers[b].size.x) + offset + window->buffers[b].size.x] = '\n';
//window->data[((y)*window->buffers[b].size.x) + offset + window->buffers[b].size.x] = '\n';
offset++;

View File

@@ -101,16 +101,19 @@ void init_termios(int args) {
current.c_lflag &= ~ICANON;
if(args == 0x01) {
current.c_lflag |= ECHO;
//current.c_lflag ^ ECHO;
} else {
current.c_lflag &= ~ECHO;
//current.c_lflag &= ~ECHO;
current.c_lflag ^= ECHO;
//current.c_lflag |= ECHO;
}
tcsetattr(0,TCSAFLUSH, &current);
tcsetattr(0,0, &current);
}
void reset_termios(void) {
tcsetattr(0, TCSAFLUSH, &old);
tcsetattr(0, TCSANOW, &old);
}
char term_getch() {
@@ -143,6 +146,7 @@ void* input_threaded_func(void* vargp) {
int term_threaded_input_stop() {
pthread_cancel(input_thread);
reset_termios();
return 1;
}