vlang / intellij-v

MIT License
33 stars 5 forks source link

The console cannot display eprintln() content, but the terminal can display it normally #8

Open tzSharing opened 1 month ago

tzSharing commented 1 month ago

Describe the bug

fn main(){
    println('111')
    eprintln('222')
    println('333')
}

Expected Behavior

Normal display

Current Behavior

run console:

run console

cmd terminal:

cmd console

Environment details (v doctor output)

V full version: V 0.4.7 fd7986c.8af19ec
OS: windows, Microsoft Windows 10 רҵ v19045 64 λ
Processor: 4 cpus, 64bit, little endian,

getwd: C:\Users\TZ
vexe: D:\v\v.exe
vexe mtime: 2024-07-27 17:14:26

vroot: OK, value: D:\v
VMODULES: OK, value: C:\Users\TZ\.vmodules
VTMP: OK, value: C:\Users\TZ\AppData\Local\Temp\v_0

Git version: git version 2.45.1.windows.1
Git vroot status: 0.4.7-5-g8af19ece (13 commit(s) behind V master)
.git/config present: true

CC version: Error: 'cc' is not recognized as an internal or external command,
operable program or batch file.

thirdparty/tcc status: thirdparty-windows-amd64 b425ac82

IDE Type (IDEA Community/Ultimate, GoLand, CLion, etc.)

IntelliJ IDEA 2024.1.4 (Community Edition)
Build #IC-241.18034.62, built on June 21, 2024
Runtime version: 17.0.11+1-b1207.24 amd64
VM: OpenJDK 64-Bit Server VM by JetBrains s.r.o.
Windows 10.0
Kotlin 插件: K2 Kotlin 模式(Alpha)
GC: G1 Young Generation, G1 Old Generation
Memory: 2048M
Cores: 4
Registry:
  ide.experimental.ui=true
Non-Bundled Plugins:
  com.intellij.zh (241.271)
  io.vlang (0.0.1-beta.5)
Kotlin: 241.18034.62-IJ

Plugin Version

0.0.1-beta.5

Krotki commented 3 weeks ago

I noticed few different behaviours regarding terminal. Sometimes error is not printed at all, sometimes error is printed before anything else and sometimes (very rarely) printed as it should.

I think it is related to asynchronous behavior of command line handler in vlang, but I do not have a clue yet how to fix it.

crackedmind commented 1 week ago

simple C.fprintf(C.stderr, c'test') didn't work also

but, after disabling "emulate terminal" option in run configuration, output is expected but eprintln/panic in err handler still not working