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’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature: Exit on completion #1

Closed
ptrkrlsrd opened this issue Aug 19, 2018 · 8 comments
Closed

Feature: Exit on completion #1

ptrkrlsrd opened this issue Aug 19, 2018 · 8 comments

Comments

@ptrkrlsrd
Copy link

Use case:

I'm currently using leader to run commands like "git commit", "go build" and such, and then I hit Ctrl-C to continue to use my shell.

Goal

When I'm done running one of the selected command, I'd like to carry on using my shell. In other words I'd like leader to exit back to the shell once I've run a command and then if I need leader again I'll hit .

@dhamidi
Copy link
Owner

dhamidi commented Aug 19, 2018

Hey Petter,

thank you for the report. The desired behavior is actually what leader already implements and I failed to reproduce it using leader version v0.1.5.

Could you post your ~/.leaderrc here along with which shell you are using?

@dhamidi
Copy link
Owner

dhamidi commented Aug 25, 2018

Hey @ptrkrlsrd

Just a heads-up: if there is no movement on this issue by Monday, I will close it due to inactivity.

@ptrkrlsrd
Copy link
Author

Hey,

Sorry for the late reply. I'm using zsh and the newest version of Leader. I've been using Leader quite a lot (because I find it great), but still can't seem to make it exit after running a command without using Ctrl-C.

My current leaderrc looks like this:

{
  "keys": {
    "G": {
      "name": "git",
      "keys": {
        "l": "git log",
        "c": "git commit",
        "p": "git push origin master"
      }
    },
    "g": {
      "name": "go",
      "keys": {
        "b": "go build .",
        "t": {
          "name": "test",
          "loopingKeys": ["."],
          "keys": {
            ".": "go test .",
            "a": "go test ./..."
          }
        }
      }
    },
    "k": {
      "name": "kubernetes",
      "keys": {
        "s": "kubectl get service",
        "p": "kubectl get pod"
      }
    }
  }
}

@dhamidi
Copy link
Owner

dhamidi commented Aug 29, 2018

Hey @ptrkrlsrd

Thank you for the details, I will investigate as soon as possible.

@ptrkrlsrd
Copy link
Author

@dhamidi I did a little investigation myself, and it seems like I can run commands in the shell after picking a command with leader, but the shell doesn't render properly. Or is this the wanted behavior?

The image below shows the issue. First I run 'kubectl get service' using Leader(k -> s in my case), then I type and run 'ls'. As you see it returns the output of 'ls' (in this case "Dockerfile") in the same shell block as the output of Leader. I suspect this might be an issue with ZSH or even my ZSH theme, but I thought I'd let you know.

untitled

@dhamidi
Copy link
Owner

dhamidi commented Aug 29, 2018 via email

@dhamidi
Copy link
Owner

dhamidi commented Aug 29, 2018

Hey @ptrkrlsrd

adding zle reset-prompt to the zsh initialization code did indeed fix the issue.

I've created a new release with the fix, which you can find here: https://github.com/dhamidi/leader/releases/tag/v0.3.1

Let me know whether this resolves the issue for you, in which case I'll close this issue.

@dhamidi
Copy link
Owner

dhamidi commented Oct 1, 2018

Closing this due to inactivity

@dhamidi dhamidi closed this as completed Oct 1, 2018
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

2 participants