mirror of
https://github.com/joncampbell123/dosbox-x.git
synced 2025-05-09 03:41:10 +08:00
Additional fix for Backspace key in shell
This commit is contained in:
parent
49f77509a2
commit
af39264c77
@ -1003,30 +1003,28 @@ void DOS_Shell::InputCommand(char * line) {
|
|||||||
backone();
|
backone();
|
||||||
if(bytes == 2 && str_len >= 2) backone();
|
if(bytes == 2 && str_len >= 2) backone();
|
||||||
|
|
||||||
if(str_index < str_len) {
|
if(str_index < str_len)
|
||||||
for(uint16_t i = str_index - bytes; i < str_len - bytes; i++) {
|
memmove(&line[str_index - bytes], &line[str_index], str_len - str_index); // Shift buffer to left
|
||||||
line[i] = line[i + bytes]; // Shift buffer to left
|
|
||||||
}
|
|
||||||
}
|
|
||||||
line[str_len - 1] = '\0';
|
line[str_len - 1] = '\0';
|
||||||
if(bytes == 2)line[str_len - 2] = '\0';
|
if(bytes == 2)line[str_len - 2] = '\0';
|
||||||
str_len -= bytes;
|
str_len -= bytes;
|
||||||
str_index -= bytes;
|
str_index -= bytes;
|
||||||
size -= bytes;
|
size -= bytes;
|
||||||
if(str_index < str_len) {
|
|
||||||
for(int i = str_len; i > 0; i--) backone();
|
|
||||||
|
|
||||||
|
for(int i = str_len; i > 0; i--) backone();
|
||||||
|
col = CURSOR_POS_COL(page);
|
||||||
|
while(col > prompt_col) {
|
||||||
|
backone();
|
||||||
col = CURSOR_POS_COL(page);
|
col = CURSOR_POS_COL(page);
|
||||||
while(col > prompt_col) {
|
}
|
||||||
backone();
|
|
||||||
col = CURSOR_POS_COL(page);
|
|
||||||
}
|
|
||||||
|
|
||||||
uint16_t a = str_len;
|
uint16_t a = str_len;
|
||||||
uint8_t* text = reinterpret_cast<uint8_t*>(&line[0]);
|
uint8_t* text = reinterpret_cast<uint8_t*>(&line[0]);
|
||||||
DOS_WriteFile(STDOUT, text, &a); // Rewrite the command history
|
DOS_WriteFile(STDOUT, text, &a); // Rewrite the command history
|
||||||
outc(' '); outc(' '); backone(); backone();
|
outc(' '); outc(' '); backone(); backone();
|
||||||
|
|
||||||
|
if(str_index < str_len) {
|
||||||
for(int i = str_len; i > 0; i--) backone();
|
for(int i = str_len; i > 0; i--) backone();
|
||||||
col = CURSOR_POS_COL(page);
|
col = CURSOR_POS_COL(page);
|
||||||
while(col > prompt_col) {
|
while(col > prompt_col) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user