git.ucc.asn.au
/
tpg
/
acess2.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Kernel/PCI - Added function to access the Command field, better BAR functions
[tpg/acess2.git]
/
Usermode
/
Applications
/
gui_shell_src
/
vt100.c
diff --git
a/Usermode/Applications/gui_shell_src/vt100.c
b/Usermode/Applications/gui_shell_src/vt100.c
index
621cb10
..
09a96d9
100644
(file)
--- a/
Usermode/Applications/gui_shell_src/vt100.c
+++ b/
Usermode/Applications/gui_shell_src/vt100.c
@@
-34,13
+34,12
@@
int Term_HandleVT100(int Len, const char *Buf)
if( inc_len > 0 || *Buf == '\x1b' )
{
if( inc_len > 0 || *Buf == '\x1b' )
{
+ // Handle VT100 (like) escape sequence
int new_bytes = min(MAX_VT100_ESCAPE_LEN - inc_len, Len);
int new_bytes = min(MAX_VT100_ESCAPE_LEN - inc_len, Len);
- int ret = 0;
+ int ret = 0
, old_inc_len = inc_len
;
memcpy(inc_buf + inc_len, Buf, new_bytes);
memcpy(inc_buf + inc_len, Buf, new_bytes);
- inc_len += new_bytes;
- // Handle VT100 (like) escape sequence
-
_SysDebug("inc_len = %i, new_bytes = %i", inc_len, new_bytes)
;
+
inc_len += new_bytes
;
if( inc_len <= 1 )
return 1; // Skip 1 character (the '\x1b')
if( inc_len <= 1 )
return 1; // Skip 1 character (the '\x1b')
@@
-49,24
+48,29
@@
int Term_HandleVT100(int Len, const char *Buf)
{
case '[': // Multibyte, funtime starts
ret = Term_HandleVT100_Long(inc_len-2, inc_buf+2);
{
case '[': // Multibyte, funtime starts
ret = Term_HandleVT100_Long(inc_len-2, inc_buf+2);
- if( ret > 0 )
+ if( ret > 0 )
{
ret += 2;
ret += 2;
+ }
break;
default:
ret = 2;
break;
}
break;
default:
ret = 2;
break;
}
- if( ret != 0 )
+ if( ret != 0 )
{
inc_len = 0;
inc_len = 0;
+ ret -= old_inc_len; // counter cached bytes
+ }
return ret;
}
switch( *Buf )
{
case '\b':
return ret;
}
switch( *Buf )
{
case '\b':
- // TODO: Backspace
Display_MoveCursor(-1, 0);
Display_MoveCursor(-1, 0);
+ Display_AddText(1, " ");
+ Display_MoveCursor(-1, 0);
+ // TODO: Need to handle \t and ^A-Z
return 1;
case '\t':
// TODO: tab (get current cursor pos, space until multiple of 8)
return 1;
case '\t':
// TODO: tab (get current cursor pos, space until multiple of 8)
@@
-75,7
+79,6
@@
int Term_HandleVT100(int Len, const char *Buf)
Display_Newline(1);
return 1;
case '\r':
Display_Newline(1);
return 1;
case '\r':
- // TODO: Carriage return
Display_MoveCursor(INT_MIN, 0);
return 1;
}
Display_MoveCursor(INT_MIN, 0);
return 1;
}
@@
-129,7
+132,7
@@
int Term_HandleVT100_Long(int Len, const char *Buffer)
if( !isalpha(c) ) {
// Bother.
_SysDebug("Unexpected char 0x%x in VT100 escape code", c);
if( !isalpha(c) ) {
// Bother.
_SysDebug("Unexpected char 0x%x in VT100 escape code", c);
- return
-
1;
+ return 1;
}
if( bQuestionMark )
}
if( bQuestionMark )
@@
-167,7
+170,7
@@
int Term_HandleVT100_Long(int Len, const char *Buffer)
{
if( args[i] < 8 )
{
{
if( args[i] < 8 )
{
- // Flags?
+ //
TODO:
Flags?
}
else if( 30 <= args[i] && args[i] <= 37 )
{
}
else if( 30 <= args[i] && args[i] <= 37 )
{
UCC
git Repository :: git.ucc.asn.au