Run project in custom terminal

Answered

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?

9 comments
Comment actions Permalink

Hello!

Are you on Windows? What toolchain do you use?

0
Comment actions Permalink

Hello,

Yes, it's Windows, and I use standard cmake application toolchain.

0
Comment actions Permalink

I mean: is it MinGW, or Cygwin, or MSVC? Check File | Settings | Build, Execution, Deployment | Toolchains.

0
Comment actions Permalink

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).

0
Comment actions Permalink

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?

0
Comment actions Permalink

>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.

0
Comment actions Permalink

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.

0
Comment actions Permalink

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.

0

Please sign in to leave a comment.