mirror of
https://github.com/wichtounet/thor-os.git
synced 2025-09-15 23:47:25 -04:00
Small improvement in handling of the input
This commit is contained in:
parent
2df7dac536
commit
e0c17d79a1
@ -119,13 +119,13 @@ void pwd_command(const std::vector<std::string>&){
|
|||||||
int main(){
|
int main(){
|
||||||
get_console_information();
|
get_console_information();
|
||||||
|
|
||||||
char input_buffer[64];
|
char input_buffer[128];
|
||||||
std::string current_input;
|
std::string current_input;
|
||||||
|
|
||||||
|
print("thor> ");
|
||||||
|
|
||||||
while(true){
|
while(true){
|
||||||
print("thor> ");
|
auto c = read_input(input_buffer, 127);
|
||||||
|
|
||||||
auto c = read_input(input_buffer, 63);
|
|
||||||
|
|
||||||
if(input_buffer[c-1] == '\n'){
|
if(input_buffer[c-1] == '\n'){
|
||||||
if(c > 1){
|
if(c > 1){
|
||||||
@ -174,6 +174,8 @@ int main(){
|
|||||||
}
|
}
|
||||||
|
|
||||||
current_input.clear();
|
current_input.clear();
|
||||||
|
|
||||||
|
print("thor> ");
|
||||||
} else {
|
} else {
|
||||||
input_buffer[c] = '\0';
|
input_buffer[c] = '\0';
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user