Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to properly open a terminal editor? #77

Open
mj357 opened this issue Apr 23, 2024 · 0 comments
Open

How to properly open a terminal editor? #77

mj357 opened this issue Apr 23, 2024 · 0 comments

Comments

@mj357
Copy link

mj357 commented Apr 23, 2024

Hello 馃憢
Given this small piece of code:

import ArgumentParser
import ShellOut


@main
struct MyCliTool: ParsableCommand {

    mutating func run() throws {

        print("Hello, world!")
        try shellOut(to: "nano /tmp/somefile.txt") // or (neo)vim
    }

}

I would expect it to open up nano with the specified file. No such thing happens though:

screenshot

I experienced similar behaviour for other packages and for using Process directly.
I haven't used Swift beforehand and thought I could write my next small little CLI tool in it, this keeps me from doing so though.
Is there any way to properly start a terminal editor with ShellOut or should I search somewhere else?

Thank you :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant