Reputation: 7317
Using the Turtle
shell scripting library I am trying to launch a program, i.e:
shell "vim" empty
The problem is that this yields the warning Warning: Input is not from a terminal
and causes Vim to lag for a few seconds before finally launching.
Questions:
shell
the best Turtle function to launch an external program from haskell?Upvotes: 5
Views: 173
Reputation: 1013
You want to use functions from the process library, specifically createProcess or runProcess.
Relevant turtle thread on the issue here.
Upvotes: 4
Reputation: 60463
You could try manually setting up I/O to the vty. E.g. in bash: vim < $TTY > $TTY
. I guess turtle is doing that with its own file descriptors under the hood, based on the warning, so you should be able to manually set up those redirects (or just use the command I gave via shell
). You just need to make sure you've got a TTY
environment var around.
Upvotes: 0