You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
For example, maybe an app will want to call git to sync, or some other function that returns output.
Right now, Konsole has taken over System.in, System.out, and System.err - so we may need an escape hatch for when the user wants to say "I'm not in a Konsole block right now, let someone else print stuff for a whiel"
So I experimented with this a bit. It's not hard to do but it's probably not worth putting this into the library itself, because it's easy enough to just exec the process yourself, capture the input stream, and then just add each line into, say, a konsoleList
val output = konsoleListOf<String>()
konsole {
output.forEach { line -> textLine(line) }
textLine()
}.run {
val process = exec("...")
val reader = BufferedReader(InputStreamReader(process.inputStream))
while (true) {
val line = reader.readLine() ?: break
output.add(line)
}
}
It ends up being easier to just let the application do its own custom thing. Above, we need a reference to the process handles so we can interact with them, which makes me lean towards not trying to wrap this behavior inside Konsole.
For example, maybe an app will want to call git to sync, or some other function that returns output.
Right now, Konsole has taken over System.in, System.out, and System.err - so we may need an escape hatch for when the user wants to say "I'm not in a Konsole block right now, let someone else print stuff for a whiel"
Maybe
?
The text was updated successfully, but these errors were encountered: