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

Helix navigation breaks after shell execution failed #11853

Closed
Wang-Ji20 opened this issue Oct 8, 2024 · 4 comments
Closed

Helix navigation breaks after shell execution failed #11853

Wang-Ji20 opened this issue Oct 8, 2024 · 4 comments
Labels
C-bug Category: This is a bug

Comments

@Wang-Ji20
Copy link

Wang-Ji20 commented Oct 8, 2024

Summary

Helix supports executing shell commands via

sh <the shell command>

If the execution is failed, cursor in the buffer behave strangely.

  1. The topbar disappears if you have it. (I set it to always).
  2. The cursor is automatically duplicated to two cursors.
  3. when you move the cursor, only the second one moves, and it duplicates whatever character the first cursor is pointing to
  4. But if you write and save, no change is actually applied.

Reproduction Steps

  1. create a new file
  2. write some text in that file
  3. run sh shakfjhaskljfh in command mode.
  4. move your cursor using hjkl

my config file:

theme = "ao"

[editor]
line-number = "relative"
mouse = false
bufferline = "always"

[editor.cursor-shape]
insert = "bar"
normal = "block"
select = "underline"

[editor.file-picker]
hidden = false

Helix log

2024-10-08T15:26:16.125 helix_term::commands [ERROR] Shell error: sh: line 1: hhh: command not found

Platform

WSL opensuse-tumbleweed

Terminal Emulator

Windows Terminal

Installation Method

zypper

Helix Version

helix 24.7 (079f544)

@Wang-Ji20 Wang-Ji20 added the C-bug Category: This is a bug label Oct 8, 2024
@ngasull
Copy link

ngasull commented Dec 8, 2024

I'm facing the same issue when integrating lazygit as suggested here #12045.

It seems that commands can steal mouse from helix and that helix doesn't check that. For now, to work around this case, we can disable and re-enable mouse after interactive commands:

:set mouse false
:set mouse true

@TornaxO7
Copy link
Contributor

TornaxO7 commented Dec 8, 2024

I'm on NixOS and I'm using rio and I can't reproduce the issue.

I did the following:

  1. Copied the provided config of @Wang-Ji20 in /tmp/config.toml
  2. hx --config /tmp/config.toml /tmp/test.txt
  3. Entered some random stuff in the file, then went back to normal mode
  4. :sh random shit goes brrrrrrr
  5. navigate in normal mode

everything worked as expected. Maybe it's somehow related to the windows terminal?

@pascalkuthe
Copy link
Member

Lazgit is a tui (and therefore causiing issues), running any TUI with sh is unsupported and will not work properly. We have absolutely no plan to change that

@pascalkuthe pascalkuthe closed this as not planned Won't fix, can't repro, duplicate, stale Dec 8, 2024
@Wang-Ji20
Copy link
Author

Wang-Ji20 commented Dec 9, 2024

I'm on NixOS and I'm using rio and I can't reproduce the issue.

I did the following:

  1. Copied the provided config of @Wang-Ji20 in /tmp/config.toml
  2. hx --config /tmp/config.toml /tmp/test.txt
  3. Entered some random stuff in the file, then went back to normal mode
  4. :sh random shit goes brrrrrrr
  5. navigate in normal mode

everything worked as expected. Maybe it's somehow related to the windows terminal?

Using WezTerm still produces this issue

wez.mp4

And the config does not matter too. Using the default config still has this problem. I will try to understand why it happens.


Downloaded the prebuilt helix in github and everything works fine. Still don't know what caused this strange behavior though..

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-bug Category: This is a bug
Projects
None yet
Development

No branches or pull requests

4 participants