how to enable `\r` in TerminalExecutionConsole when running commands which don't output `\r`
I'm working on an IDEA plugin for Jenkins X: https://github.com/jenkins-x/jx-intellj-plugin and we're trying to open an interactive terminal using TerminalExecutionConsole which kinda works:
However the output never generates any `/r` characters so things wrap oddly in the UI (see below). I wonder if anyone had any bright ideas on how to configure the TerminalExecutionConsole / OSProcessHandler to deal with this? Note that the command being run is a go binary which doesn't appear to output `\r` but just `\n` for newlines.
Please sign in to leave a comment.
In my case the problem was not that the process didn't output `\r` (though I don't remember outputting it), but that the default settings of `OSProcessHandler` was actively removing them. I have fixed this by overriding `OSProcessHandler.readerOptions()` to return:
Initially I have implemented a special readers which replace `\n` with `\r\n`, but I didn't use that after all. The full code is here, if anybody is interested.