George
George

Reputation: 7317

Launching Programs (example: Vim) from Haskell

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:

  1. Is shell the best Turtle function to launch an external program from haskell?
  2. If so, is there any way to get around errors like the above?

Upvotes: 5

Views: 173

Answers (2)

soupi
soupi

Reputation: 1013

You want to use functions from the process library, specifically createProcess or runProcess.

Relevant turtle thread on the issue here.

Example usage.

Upvotes: 4

luqui
luqui

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

Related Questions