yterm

commit 42d59cc929efb9fbb9fe55b5ef0ae465f2441c51

Author: mesyeti <mesyeti@mesyeti.uk>

fix scrolling

 source/buffer.c | 2 ++
 source/interpreter.c | 4 ++++
 source/interpreter.h | 2 ++
 source/interpreter/vt100.c | 4 +---


diff --git a/source/buffer.c b/source/buffer.c
index f0f2ad075606c1b1aa66698c05fcd4f1e2243372..ee2a2ab38e870b92cc6f456578810a48e9b49219 100644
--- a/source/buffer.c
+++ b/source/buffer.c
@@ -168,4 +168,6 @@ 		BufCell* dest = Buffer_Get(buf, 0, i - by);
 
 		memcpy(dest, src, rowSize);
 	}
+
+	Buffer_ClearLine(buf, buf->height - 1, BufAttr_Default());
 }




diff --git a/source/interpreter/vt100.c b/source/interpreter/vt100.c
index b1944feb8bddb0dd29fd138e76619be324215163..bde319037a2f48afca4bcb4f61b9feaca4ddf696 100644
--- a/source/interpreter/vt100.c
+++ b/source/interpreter/vt100.c
@@ -54,11 +54,9 @@ 		if ((key >= KEY_A) || (key <= KEY_Z)) {
 			// char ch = ((char) (key + ('A' - 1))) & 0x1F;
 			char ch = ((char) ((key - KEY_A) + 'A')) & 0x1F;
 
-			printf("Sending CTRL+%c (%d)\n", ((char) ((key - KEY_A) + 'A')), ch);
-
 			static char ret[2];
 			ret[0] = ch;
-			ret[1] = 1;
+			ret[1] = 0;
 			return ret;
 		}
 	}




diff --git a/source/interpreter.c b/source/interpreter.c
index fe18bd1db4ae3ef5544d579c95dfec4857eefe3e..dd72ed1f676e2022355d0ca435f3ba8d70e29ae8 100644
--- a/source/interpreter.c
+++ b/source/interpreter.c
@@ -8,3 +8,7 @@
 void Interpreter_OnRead(Interpreter* this, Terminal* terminal, UChar ch) {
 	this->onRead(this, terminal, ch);
 }
+
+void Interpreter_OnResize(Interpreter* this, Terminal* terminal) {
+	this->onResize(this, terminal);
+}




diff --git a/source/interpreter.h b/source/interpreter.h
index ba25b6460eb506f4f7a42351171fe187658c61b0..ecf16bd8d5cd9517ea06d5c0fbab155b16e147c3 100644
--- a/source/interpreter.h
+++ b/source/interpreter.h
@@ -10,9 +10,11 @@ 	void* data;
 
 	void (*sendInput)(Interpreter* this, Terminal* terminal, Event* e);
 	void (*onRead)(Interpreter* this, Terminal* terminal, UChar ch);
+	void (*onResize)(Interpreter* this, Terminal* terminal);
 };
 
 void Interpreter_SendInput(Interpreter* this, Terminal* terminal, Event* e);
 void Interpreter_OnRead(Interpreter* this, Terminal* terminal, UChar ch);
+void Interpreter_OnResize(Interpreter* this, Terminal* terminal);
 
 #endif