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

chaining custom command issue on Windows #4147

Open
KevinNitroG opened this issue Jan 3, 2025 · 3 comments
Open

chaining custom command issue on Windows #4147

KevinNitroG opened this issue Jan 3, 2025 · 3 comments
Labels
bug Something isn't working

Comments

@KevinNitroG
Copy link

Describe the bug

While defining a custom command keybindings with a chaining command, it failed to run on Windows using cmd shell.

To Reproduce
Steps to reproduce the behavior:

  1. Config custom command keybindings in ~/AppData\Roaming\lazygit\config.yml
     customCommands:
      - key: 'G'
        context: 'global'
        command: 'git reflog expire --all --expire=now && git gc --prune=now --aggressive'
        description: 'clean up unnecessary files, reflog, optimize'
        prompts:
          - type: 'confirm'
            title: 'Cleanup'
            body: 'Are you sure you want to unnecessary files, reflog, optimize the repo?'
        loadingText: 'Cleaning up'
        stream: true
  2. Go to a repo and run G key in lazygit

Expected behavior

The command run successfully

Screenshots

image

image

Version info:

commit=611fabde11d24d9acc71ee26077b9a1101f59f27, build date=2024-09-18T10:56:10Z, build source=binaryRelease, version=0.44.1, os=windows, arch=amd64, git version=2.47.0.windows.2

@KevinNitroG KevinNitroG added the bug Something isn't working label Jan 3, 2025
@stefanhaller
Copy link
Collaborator

The reason for this is that lazygit escapes the & characters, turning them into ^&. I'm not sure why it does that, or if we can simply remove it. @jesseduffield Do you remember?

@KevinNitroG
Copy link
Author

The reason for this is that lazygit escapes the & characters, turning them into ^&. I'm not sure why it does that, or if we can simply remove it. @jesseduffield Do you remember?

when I run the command (contains "^&^&") it still works. Maybe that's not the cause

image

@jesseduffield
Copy link
Owner

The reason for this is that lazygit escapes the & characters, turning them into ^&. I'm not sure why it does that, or if we can simply remove it. @jesseduffield Do you remember?

I do not remember, but perhaps this has something to do with the fact that we previously quoted all commands, meaning we could do without the escaping now. But I'm not well versed on what we need to do for windows

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants