User input allows keyboard keys

Hi!

I am working on a shell in c++ and I have a problem with user input. Everything is fine but when I press up, down, left, or right a string starting with "^[[". I am using "cin >>" to get the command and "getline()" to get arguments.

Thanks for your help!
closed account (zwA4jE8b)
i think you might need to include conio.h and use its functions
sorry, im not sure what u mean by

..use its functions


here is my code:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
#include <iostream>
#include <string>
using namespace std;

int main( void ) {
string cmd;
string args;

while(true) {
cin >> cmd;
getline(cin,args);
DO STUFF
}
}
Topic archived. No new replies allowed.