ktye / i

interpret
100 stars 16 forks source link

k+ doesn't exit on Ctrl+D #13

Open paulapatience opened 2 years ago

paulapatience commented 2 years ago

When trying to exit k+ with Ctrl+D (rather than Ctrl+C), k+ outputs spaces forever rather than exiting.

ktye commented 2 years ago

it uses ReadIn to read a line. the c backend is generated here and uses this implementation: https://github.com/ktye/wg/blob/master/c.go#L816

it is called by the read() function, generated from this: https://github.com/ktye/i/blob/master/wasi.go#L116

and it reads at most 504 bytes..

talas commented 1 year ago

https://github.com/ktye/i/blob/master/system.go#L14 in main(), add: if !nn(x) { break } this should cause the repl loop to exit on Ctrl+D. You might want to print something as well though.