File tree Expand file tree Collapse file tree
src/main/kotlin/ai/devchat/cli Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -129,18 +129,19 @@ class Command(val cmd: MutableList<String> = mutableListOf()) {
129129 SupervisorJob () + Dispatchers .Default + exceptionHandler
130130 ).actor {
131131 val process = executeCommand(preparedCommand, ProjectUtils .project?.basePath, env)
132+ val writer = process.outputStream.bufferedWriter()
132133 val deferred = async {process.await(onOutput, onError)}
133134 var exitCode = 0
134135 whileSelect {
135136 deferred.onAwait {
137+ writer.close()
136138 exitCode = it
137139 false
138140 }
139- channel.onReceive {msg ->
140- process.outputStream.use {
141- it.write(msg.toByteArray())
142- }
143- Log .info(" Input wrote: $msg " )
141+ channel.onReceive {
142+ writer.write(it)
143+ writer.flush()
144+ Log .info(" Input wrote: $it " )
144145 true
145146 }
146147 }
You can’t perform that action at this time.
0 commit comments