Run project in custom terminal
已回答
Basically what I would like to do, is, that the buffered console-like viewer, that all programs show their streams when ran via RUN or DEBUG command would support ansi escape codes. Since this is impossible, is there some way to.. when the application is ran, open it in some specified terminal program, or to pipe std streams somewhere? Thanks.
Also, if you open a local terminal inside clion, it runs the default system's terminal. Isn't there a way so that when the solution is ran, first, build and do all the stuff somewhere, but the last execution commands to be done in this console?
请先登录再写评论。
Hello!
Are you on Windows? What toolchain do you use?
Hello,
Yes, it's Windows, and I use standard cmake application toolchain.
I mean: is it MinGW, or Cygwin, or MSVC? Check File | Settings | Build, Execution, Deployment | Toolchains.
MinGW, yeah.
In case of MinGW you can disable PTY: go to Help | Find Action, type "Registry...", select it and in the opened list find and disable the run.processes.with.pty option. This will make ansi escape codes work.
And feel free to comment or upvote https://youtrack.jetbrains.com/issue/CPP-6949. See https://intellij-support.jetbrains.com/hc/en-us/articles/207241135-How-to-follow-YouTrack-issues-and-receive-notifications if you are not familiar with YouTrack.
Also you can switch to Cygwin. In case of Cygwin ansi escape codes work properly in Run/Debug tool windows (even without disabling PTY).
Allright, I have tested the registry fix, the the terminal is blank for the whole runtime of the application, and after exit, the buffer with ansi escape codes working is displayed. Thank you for this at least.
Do I understand that this is unexpected behavior and it will need to be fixed in upcomming updates?
>the the terminal is blank for the whole runtime of the application, and after exit, the buffer with ansi escape codes working is displayed
Unfortunately, these are the consequences of disabling PTY.
Isn't switching to Cygwin acceptable to you? In case of Cygwin you don't need to disable PTY so that ansi escape codes work.
Switching to Cygwin means more than 5 hours of re-referencing libraries, dependencies,link directories.. It would be easier to create an assembly hook to the terminal and fix the error that way.
I'm afraid for now there is no way to use an external terminal instead of Run/Debug tool window. Feel free to comment or upvote https://youtrack.jetbrains.com/issue/CPP-1576.