Skip to content
This repository was archived by the owner on Oct 25, 2020. It is now read-only.
This repository was archived by the owner on Oct 25, 2020. It is now read-only.

Doesn't work with VSCode as $EDITOR #27

Closed

Description

@ysamlan

On OS X, if you do

export EDITOR=code

then it just opens a blank editor for me when running ska rather than opening the template's .toml file.

Activity

  1. self-assigned this
    on Jun 7, 2019
  2. xdefrag commented on Jun 7, 2019

    @xdefrag
    Owner

    @ysamlan I don't use vscode myself, tested this app only with emacs and vim. Just checked it and bumped into same behavior. Would investigate further.

  3. xdefrag commented on Jun 8, 2019

    @xdefrag
    Owner

    I get it. Ska works well with any console editor and doesn't work with visual one because that's how editor invoked:

    func invokeEditor(ed, p string) error {
    	cmd := exec.Command(ed, p)
    	cmd.Stdin = os.Stdin
    	cmd.Stdout = os.Stdout
    	cmd.Stderr = os.Stderr
    
    	return cmd.Run()
    }

    App just pass to editor controls over console and wait till it's done and pass it back so we would knew when values.toml is ready.

    We can resolve this by manual copying values.toml and call ska with value parameter #24. Or command that's copies values.toml and overrides whole step with editor invocation if values.toml detected in current directory.

  4. ysamlan commented on Jun 10, 2019

    @ysamlan
    ContributorAuthor

    Yep, I use vim personally (at least for shell editor) so i've never hit this either, but I'm trying to make a somewhat newbie-friendly set of templates on the current project I'm working on and a co-worker hit this, sadly.

    So some extra info from https://stackoverflow.com/a/36644561/59058 makes me think this should work with either code --wait or at least code -n --wait, but doesn't seem to be a good way to set that as $EDITOR directly (for git you do it via git config core.editor instead of just $EDITOR). I was able to make a file called codewait.sh with just this in it:

    #!/bin/bash
    code --wait -n $@

    And when I set that codewait.sh script as $EDITOR it worked fine... could either just document this, or special-case it if $EDITOR is code (since that does seem to be a popular choice these days).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

    ⌂ 换网址