Surprisingly I didn't find an answer to this seemingly very common problem. In Python when I print something to the CLion Console when the printed text is longer than 80 characters, an automatic line break is inserted. In hexadecimal I can see the inserted symbol is carriage return (0D 0A) on Windows. How can I stop this from happending?
Example:
print("99b17c2b92123eb0ba2a0afb2568d18247fc2b24385a65b8e2da7245bef278f799b17c2b92123eb0ba2a0afb2568d18247fc2b24385a65b8e2da7245bef278f7")
On the console it will automatically insert a line break after 80 characters:
Connected to pydev debugger (build 203.7148.70)
99b17c2b92123eb0ba2a0afb2568d18247fc2b24385a65b8e2da7245bef278f799b17c2b92123eb0
ba2a0afb2568d18247fc2b24385a65b8e2da7245bef278f7
I just want this to be printed unmodified like as follows:
Connected to pydev debugger (build 203.7148.70)
99b17c2b92123eb0ba2a0afb2568d18247fc2b24385a65b8e2da7245bef278f799b17c2b92123eb0ba2a0afb2568d18247fc2b24385a65b8e2da7245bef278f7
As it turns out, this is a CLion bug which is still unresolved. However, a solution has been posted here:
- go to
Help|Edit Custom VM Options- when asked to create
.vmoptionfile press OK- add
-Dwin.pty.cols=120(the number here is for console output width) restartCLionYou might want to use this becauserun.processes.with.ptycan be useful for an output ofC/C++applications.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With