withfig / fig

Public issue tracker for Fig.
https://fig.io
MIT License
2.06k stars 63 forks source link

Ctrl+C is sent as `^[[99;5u` #2751

Closed 5ouma closed 9 months ago

5ouma commented 11 months ago

Checks

Operating system

macOS 12.6.9 (21G726)

Expected behaviour

I can stop the running process with Ctrl+C.

Actual behaviour

When I type Ctrl+C, it's sent as ^[[99;5u.

Steps to reproduce

When I run zshrc.post.zsh with zsh-defer loaded, the keystroke is sent as ^[[99;5u.

This is the issue of zsh-defer I asked the author of it. https://github.com/romkatv/zsh-defer/issues/12

Environment

fig-details:
  - 2.16.0
hardware-info:
  - model: 
  - model-id: 
  - chip-id: Intel(R) Core(TM) i5-8279U CPU @ 2.40GHz
  - cores: 4
  - mem: 8.00 GB
os-info:
  - macOS 12.6.9 (21G726)
environment:
  - shell: /bin/zsh
  - terminal: iterm
  - cwd: /Users/souma
  - exe-path: /usr/local/bin/fig
  - install-method: brew
  - env-vars:
    - FIGTERM_SESSION_ID: bc3451aa-97c1-4733-94f1-dd8dcd7f6e42
    - FIG_SET_PARENT_CHECK: 1
    - FIG_TERM: 2.16.0
    - PATH: /Users/souma/.local/share/rtx/installs/node/20.7.0/bin:/Users/souma/.local/share/rtx/installs/go/1.21.1/go/bin:/Users/souma/.local/share/rtx/installs/go/1.21.1/packages/bin:/Users/souma/.local/share/sheldon/repos/github.com/wfxr/forgit/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/Library/Apple/usr/bin:/Users/souma/.dotfiles:/usr/local/sbin:/Applications/iTerm.app/Contents/Resources/utilities:/Users/souma/.orbstack/bin:/Users/souma/.fig/bin:/Users/souma/.local/bin
    - SHELL: /bin/zsh
    - TERM: xterm-256color
    - ZDOTDIR: /Users/souma/.config/zsh
    - __CFBundleIdentifier: com.googlecode.iterm2
    - FIG_PID: 71283
    - FIG_SET_PARENT: bc3451aa-97c1-4733-94f1-dd8dcd7f6e42
mschrage commented 11 months ago

This sounds like a potential compatibility issue with your zsh configuration.

Can you run fig debug-keytester and press ^C

5ouma commented 11 months ago

Do you mean fig debug key-tester?

7 bytes : "\x1b[99;5u" : [1b, 5b, 39, 39, 3b, 35, 75]
GodRuiAn commented 11 months ago

I encounter this problem frequently, but it doesn't happen every time. I uninstall iterm2. Install the iterm2 Stable Releases again.

This time, Ctrl + C works:

❯ fig debug key-tester
Testing Key Input (use ctrl-d to quit)
1 bytes : "\x03" : [3]
1 bytes : "\x04" : [4]
ctrl-d

Sometime, when I run ping baidu.com, for example, Ctrl + C becomes print ^[[99;5u.

❯ ping baidu.com -c 10
PING baidu.com (198.18.13.118): 56 data bytes
64 bytes from 198.18.13.118: icmp_seq=0 ttl=64 time=0.267 ms
64 bytes from 198.18.13.118: icmp_seq=1 ttl=64 time=0.599 ms
^[[99;5u64 bytes from 198.18.13.118: icmp_seq=2 ttl=64 time=0.610 ms
64 bytes from 198.18.13.118: icmp_seq=3 ttl=64 time=0.619 ms
64 bytes from 198.18.13.118: icmp_seq=4 ttl=64 time=0.581 ms
64 bytes from 198.18.13.118: icmp_seq=5 ttl=64 time=0.647 ms
64 bytes from 198.18.13.118: icmp_seq=6 ttl=64 time=0.498 ms
64 bytes from 198.18.13.118: icmp_seq=7 ttl=64 time=0.523 ms
64 bytes from 198.18.13.118: icmp_seq=8 ttl=64 time=0.656 ms
64 bytes from 198.18.13.118: icmp_seq=9 ttl=64 time=0.597 ms

--- baidu.com ping statistics ---
10 packets transmitted, 10 packets received, 0.0% packet loss
round-trip min/avg/max/stddev = 0.267/0.560/0.656/0.108 ms
❯ 9;5u
cd: no such entry in dir stack
zsh: command not found: 5u
❯ fig debug key-tester
Testing Key Input (use ctrl-d to quit)
7 bytes : "\x1b[99;5u" : [1b, 5b, 39, 39, 3b, 35, 75]
8 bytes : "\x1b[100;5u" : [1b, 5b, 31, 30, 30, 3b, 35, 75]
cruzluna commented 10 months ago
❯ fig debug-keytester
error: unrecognized subcommand 'debug-keytester'

❯ fig debug key-tester
Testing Key Input (use ctrl-d to quit)
7 bytes : "\x1b[99;5u" : [1b, 5b, 39, 39, 3b, 35, 75]

Any update on a resolution? This is making fig unusable.

5ouma commented 9 months ago

Close this Issue since CodeWhisperer for Command Line solved this problem.

cruzluna commented 9 months ago

Close this Issue since CodeWhisperer for Command Line solved this problem.

Does this mean I need to download Code Whisperer?

5ouma commented 9 months ago

Close this Issue since CodeWhisperer for Command Line solved this problem.

Does this mean I need to download Code Whisperer?

I recommend you to use it. If you don’t use any features except Autocompletion or AI, CodeWhisperer CL is much more stable than Fig.