Why is CLion printing back inputs from standard input?

已回答

Every time I try to get input from the prompt using C or C++ the string is printed back to the terminal, why is that and how can I fix it? It's pretty annoying and confusing.

 

For example this program in C

#include <stdio.h>

int main() {
char x[64];
scanf("%s", x);
return 0;
}

should not print any text but this is the output I get instead

This is  what I expected and actually get when compiling and running the program outside of CLion

 

The same goes for C++

#include <iostream>
#include <string>
using namespace std;

int main() {
string name;
getline(cin, name);
return 0;
}

 

#include <iostream>
#include <string>
using namespace std;

int main() {
string name;
cin >> name;
return 0;
}

 

Both these programs have the same issue

I am running CLion 2017.2.3 with MingWx64 on Windows 10 x64

 

0

Hi!

We have the issue in the tracker already: https://youtrack.jetbrains.com/issue/CPP-2580. Please feel free to comment or upvote.

Also you can try the workaround described in the ticket: open Registry via Find Action, type run.processes.with.pty and disable this pty setting.

Sorry for the inconvenience!

0

Issue is still happening on OSX Mojave and Catalina. Please how do I fix this??

0

请先登录再写评论。