Closed mikaelstaldal closed 2 months ago
You can control interactivity and other info values by passing them to the terminal constructor. There are a couple of examples of setting the terminal in the clikt docs.
OK. However, would be nice to be able to control interactivity directly, creating an CliKt issue for that: https://github.com/ajalt/clikt/issues/517
Seems like you cannot combine setting Terminal with context
and test
, since test
overrides the Terminal :shrug:
MyCommand().context {
terminal = Terminal(interactive = true)
}.test("foo bar")
You're right, that needs to be customizable with test
. That's a clikt issue, though, so I'm closing this one.
I am working with an application which behaves differently depending on values in
TerminalInfo
, and it would be nice to be able to control those for automated integration tests which are run in a separate process started withjava.lang.ProcessBuilder
on JVM. In particular, I need to controlinputInteractive
andoutputInteractive
, but everthing inTerminalInfo
would be nice to be able to control.Now
inputInteractive
andoutputInteractive
are false when using a subprocess.I fetch
TerminalInfo
through CliKi'sCliktCommand.terminal.info
. (Perhaps this should be an issue on CliKt, but would be nice to do the same if you use Mordant without CliKi I guess.)