Running programs (example: Vim) from Haskell

Using the Turtle shell script library, I am trying to run a program, i.e.

 shell "vim" empty 

The problem is that this gives a Warning Warning: Input is not from a terminal and causes Vim to linger for a few seconds until it is finally launched.

Questions:

  • Is shell best Turtle feature to run an external program from haskell?
  • If so, is there a way around workarounds like the ones described above?
+5
source share
2 answers

You want to use functions from process , in particular createProcess or runProcess .

The corresponding stream of turtles on the issue is here .

Usage example .

+4
source

You can try to manually configure I / O on vty. For instance. in bash: vim < $TTY > $TTY . I think the turtle does this with its file descriptors under the hood, based on the warning, so you should be able to manually configure these redirects (or just use the command that I gave through shell ). You just need to make sure you have a var TTY environment.

0
source

All Articles