It's been over ten years that whenever I need to use anything from *nix world and I always get that same error with arrows in terminal. To get that basic behavior done right always requires superpowers in google searching. It's like a car that requires me to go deep into transmission whenever I need to drive it.
I have current LTS ubuntu and yet again I noticed something wrong. Right now in default install CTRL+[left/right] doesn't jump by word. Kind of strange, if I'm not mistaken, I think I had it working in properly in default freebsd like 10 years ago. Anyways, it seems that even default left and right do not work properly by default! If I type:
pxd[LEFT][LEFT][DEL]w[ENTER]
then I get pwd, obviously (hopefully?) What I noticed now is that it doesn't work that way in a plain c++ cmd line app. Here's sample code:
#include <iostream>
#include <string>
using namespace std;
int main()
{
string s;
getline(cin, s);
cout << "nn{n" << s << "n}" << endl;
}
now compile and run it: g++ test.cpp -o test && ./test and enter that same key sequence that resulted in pwd in bash. Suddenly it won't work. I get this mess: p[3~w Wtf is wrong with terminal in all *nixes?
Recent Questions...
ما را در سایت Recent Questions دنبال میکنید
برچسب:
نویسنده: استخدام کار
بازدید: 273
تاريخ: سه
شنبه
12 مرداد
1395 ساعت: 12:31