I' trying to launch a terminal editor such as vi or nano in a command line program written in Swift.
Here's a naive attempt, I'm guessing that the standard input and output should be different. The program outputs nothing.
let task = Process()
task.launchPath = "/usr/bin/env"
task.arguments = ["nano"]
task.standardInput = FileHandle(forReadingAtPath: "/dev/tty")
task.standardOutput = FileHandle(forWritingAtPath: "/dev/tty")
task.launch()
task.waitUntilExit()