jesseduffield / lazygit

simple terminal UI for git commands
MIT License
52.29k stars 1.83k forks source link

Issue in display lazygit with vscode terminal #3930

Open hsayed21 opened 1 month ago

hsayed21 commented 1 month ago

Describe the bug I'm facing an issue in working lazygit with vscode terminal not working perfectly. When selecting the custom menu with sub-options the display cracked.

video for the issue https://github.com/user-attachments/assets/729642e3-b510-4fd0-96ca-cd50bb98c130

To Reproduce Steps to reproduce the behavior: the same in the video

Expected behavior this is a video from windows terminal working fine. I should expect like this https://github.com/user-attachments/assets/a3ab1af8-e958-4eb2-aa69-0fe71855bf05

Screenshots vscode insider version image

vscode image

Version info: Run lazygit --version and paste the result here commit=611fabde11d24d9acc71ee26077b9a1101f59f27, build date=2024-09-18T10:56:10Z, build source=binaryRelease, version=0.44.1, os=windows, arch=amd64, git version=2.46.0.windows.1

Run git --version and paste the result here git version 2.46.0.windows.1

Additional context

stefanhaller commented 2 weeks ago

I just tested this on my Windows machine, worked fine. I'm using VS Code 1.94.1.

Do you maybe have any VS Code extensions running that might have influence on the terminal behavior?

flashgnash commented 6 days ago

Works as expected in my vscode terminal (tested the following)

What's your powershell version? I know vscode often decides its own version of powershell on windows and doesn't use the one windows terminal defaults to, that could have something to do with it

hsayed21 commented 6 days ago

I just tested this on my Windows machine, worked fine. I'm using VS Code 1.94.1.

Do you maybe have any VS Code extensions running that might have influence on the terminal behavior?

I disabled all extensions but the same

hsayed21 commented 6 days ago

I just update the vscode, powershell and lazygit and still the issue vscode => 1.94.2 powershe => 7.4.5 lazygit => 0.44.1

also, I tested with Command Line (cmd) in vscode and still the issue

hsayed21 commented 6 days ago

this my config "C:\Users\user\AppData\Local\lazygit\config.yml"

git:
  branchLogCmd: "git log --graph --color=always --abbrev-commit --decorate --date=relative --pretty=medium --oneline {{branchName}} --"
  allBranchesLogCmd: 'git log --graph --all --color=always --abbrev-commit --decorate --date=relative  --pretty=medium'
  paging:
    # colorArg: always
    # pager: delta --dark --paging=never
    # pager: diff-so-fancy
    externalDiffCommand: difft --color=always # perfect for windows https://difftastic.wilfred.me.uk/
gui:
  sidePanelWidth: 0.25
  theme:
    selectedLineBgColor:
      - underline
    selectedRangeBgColor:
      - underline
  nerdFontsVersion: "3"
refresher:
  refreshInterval: 3
os:
  editPreset: "vscode"
  edit: "nvim"

# Possible keybindings https://github.com/jesseduffield/lazygit/blob/master/docs/keybindings/Custom_Keybindings.md
customCommands:
  # Conventional commit
  - key: "<c-a>"
    context: "files"
    # context: "global"
    description: "Create new conventional commit"
    prompts:
      - type: "menu"
        key: "Type"
        title: "Type of change"
        options:
          - name: "init"
            description: "๐ŸŽ‰ Initial commit"
            value: "๐ŸŽ‰ Initial commit"
          - name: "add"
            description: "โž• Add new files"
            value: "โž• add: "
          - name: "update"
            description: "๐Ÿ”จ Update existing code or files"
            value: "๐Ÿ”จ update: "
          - name: "improve"
            description: "โšก๏ธ Improve performance or functionality"
            value: "โšก๏ธ improv: "
          - name: "refactor"
            description: "โ™ป๏ธ Refactor code without changing functionality"
            value: "โ™ป๏ธ refactor: "
          - name: "style"
            description: "๐Ÿ’„ Update code style"
            value: "๐Ÿ’„ style: "
          - name: "fix"
            description: "๐Ÿž Fix a bug"
            # value: "๐Ÿ› fix: "
            value: "๐Ÿž fix: "
          - name: "remove"
            description: "โž– Remove files or code"
            value: "โž– remov: "
          - name: "feat"
            description: "๐ŸŒŸ Add a new feature"
            value: "๐ŸŒŸ feat: "
          - name: "clean"
            description: "๐Ÿงน Clean up code"
            value: "๐Ÿงน Clean-up code"
          - name: "inprogress"
            description: "๐Ÿšง Work in progress"
            value: "๐Ÿšง Work in progress"
          - name: "test"
            description: "๐Ÿงช Add or update tests"
            value: "๐Ÿงช For Testing"
          - name: "merge"
            description: "๐Ÿ”€ Merge branches"
            value: "๐Ÿ”€ Merge branches"
          - name: "bad"
            description: "๐Ÿ’ฉ Add bad code that needs improvement"
            value: "๐Ÿ’ฉ Write bad code that needs to be improved"
          - name: "hotfix"
            description: "๐Ÿš‘๏ธ Apply a critical hotfix"
            value: "๐Ÿš‘๏ธ Critical hotfix "
          - name: "revert"
            description: "โช๏ธ Revert changes"
            value: "โช๏ธ revert: "
          - name: "review"
            description: "๐Ÿ‘Œ Apply code review changes"
            value: "๐Ÿ‘Œ Code review changes"
          - name: "addtest"
            description: "โœ… Add or improve tests"
            value: "โœ… test: "
          - name: "config"
            description: "๐Ÿ”ง Change configuration files"
            value: "๐Ÿ”ง Changing configuration files"
          - name: "secur"
            description: "๐Ÿ”’๏ธ Fix security issues"
            value: "๐Ÿ”’๏ธ Fixing security issues"
          - name: "doc"
            description: "๐Ÿ“š Update documentation"
            value: "๐Ÿ“š docs: "
          - name: "releas"
            description: "๐Ÿ“ฆ๏ธ Release a new version"
            value: "๐Ÿ“ฆ๏ธ Releasing v "
          - name: "tag"
            description: "๐Ÿ”– Tag a new version"
            value: "๐Ÿ”– Tag v "
          - name: "empty"
            description: "Empty Text"
            value: ""
      - type: "input"
        title: "{{.Form.Type}}"
        key: "Message"
        initialValue: ""
      - type: "confirm"
        key: "Confirm"
        title: "Commit"
        body: "Are you sure you want to commit?"
    command: "git commit --message '{{.Form.Type}}{{.Form.Message}}'"
    loadingText: "Creating conventional commit..."
  # Add empty commit
  - key: 'E'
    description: 'Add empty commit'
    context: 'commits'
    command: 'git commit --allow-empty -m "nothing to see here"'
    loadingText: 'Committing empty commit...'
  # Fetch a remote branch as a new local branch
  - key: 'N'
    description: 'fetch a remote branch as a new local branch'
    command: "git fetch {{.SelectedRemoteBranch.RemoteName}} {{.SelectedRemoteBranch.Name}}:{{index .PromptResponses 0}}"
    context: 'remoteBranches'
    prompts:
      - type: 'input'
        title: 'New Local Branch Name'
        initialValue: ''
    loadingText: 'fetching and creating branch'
  - key: '<c-n>'
    description: 'fetch a remote branch as a new local branch'
    command: "git fetch {{index .SelectedRemote.Name }} {{index .PromptResponses 0}}:{{index .PromptResponses 1}}"
    context: 'remotes'
    prompts:
      - type: 'input'
        title: 'Remote Branch Name'
        initialValue: ''
      - type: 'input'
        title: 'New Local Branch Name'
        initialValue: ''
    loadingText: 'fetching and creating branch'
  # Pushing a specific commit
  - key: '<c-p>'
    command: "git push {{.SelectedRemote.Name}} {{.SelectedLocalCommit.Sha}}:{{.SelectedLocalBranch.RefName}}"
    context: "commits"
    loadingText: "Pushing specific commit..."
    description: "Push a specific commit (and any preceding)"
    stream: yes
  # Clean untracked files
  - key: x
    context: 'files'
    command: "git clean -fd"
    description: "Clean untracked files"
    prompts:
    - type: confirm
      title: "Clean"
      body: "Are you want to remove all untracked files?"
  # Blame via tig
  - key: b
    command: tig blame -- {{.SelectedFile.Name}}
    context: files
    description: blame file at tree
    subprocess: yes
  - key: B
    command: tig blame -- {{.SelectedCommitFile.Name}}
    context: commitFiles
    description: blame file at tree
    subprocess: yes
  - key: b
    command: tig blame {{.SelectedLocalCommit.Sha}} -- {{.SelectedCommitFile.Name}}
    context: commitFiles
    description: blame file at revision
    subprocess: yes
  # Browse files at revision via tig
  - key: t
    command: tig show {{.SelectedSubCommit.Sha}}
    context: subCommits
    description: tig commit (`t` again to browse files at revision)
    subprocess: yes
  - key: t
    command: tig show {{.SelectedLocalBranch.Name}}
    context: localBranches
    description: tig branch (`t` again to browse files at revision)
    subprocess: yes
  - key: t
    command: tig show {{.SelectedRemoteBranch.RemoteName}}/{{.SelectedRemoteBranch.Name}}
    context: remoteBranches
    description: tig branch (`t` again to browse files at revision)
    subprocess: yes
  # File history via tig
  - key: h
    command: tig {{.SelectedLocalCommit.Sha}} -- {{.SelectedCommitFile.Name}}
    context: commitFiles
    description: tig file (history of commits affecting file)
    subprocess: yes
  - key: h
    command: tig -- {{.SelectedFile.Name}}
    context: files
    description: tig file (history of commits affecting file)
    subprocess: yes
  # Merge staff
  - key: 'M'
    prompts:
      - type: 'menu'
        title: 'Select Option'
        options:
          - name: 'Squash'
            description: 'Merge Squash'
            value: '--squash'
          - name: 'FastForward'
            description: 'Merge FastForward'
            value: '--ff'
          - name: 'No-FastForward'
            description: 'Merge FastForward'
            value: '--no-ff'
    command: 'git merge {{index .PromptResponses 0}} {{.SelectedLocalBranch.Name}}'
    context: 'localBranches'
    description: 'Merge Squash'
  - key: '<f1>'
    context: 'files'
    command: 'git checkout --ours  -- {{.SelectedPath}}'
    description: 'Merge ours(HEAD)'
  - key: '<f2>'
    context: 'files'
    command: 'git checkout --theirs -- {{.SelectedPath}}'
    description: 'Merge theirs'
  - key: D
    description: 'change commit date to now'
    context: 'commits'
    command: 'git commit --amend --no-edit --date "$(date)"'

  # Comparing a file in a previous revision with the working copy
  # - key: 'f'
  #   command: "git difftool -y {{.SelectedLocalCommit.Sha}} -- {{.SelectedCommitFile.Name}}"
  #   context: 'commitFiles'
  #   description: 'Compare (difftool) with local copy'