oren
1
I couldn’t find it on https://crystal-lang.org/api/, https://crystal-lang.org/reference, or https://github.com/askn/crystal-by-example but someone on Gitter mentioned
Process.run(ENV\["EDITOR"\], args: {"myfile.txt"})
When I run crystal src/note.cr
the program just terminated after about a second and I don’t see VIM.
oren
2
I posted it also on reddit so instead of commenting both here and there i’ll just link to the reddit discussion:
jhass
3
Process.run
does not connect stdout, stderr and stdin by default, you need to do it explicitly:
Process.run("vim", output: :inherit, error: :inherit, input: :inherit)
EDIT: Or actually just use system
: system("vim")
.
1 Like