ohmyzsh / ohmyzsh

🙃 A delightful community-driven (with 2,400+ contributors) framework for managing your zsh configuration. Includes 300+ optional plugins (rails, git, macOS, hub, docker, homebrew, node, php, python, etc), 140+ themes to spice up your morning, and an auto-update tool that makes it easy to keep up with the latest updates from the community.
https://ohmyz.sh
MIT License
172.6k stars 25.83k forks source link

Display Issue in Zsh Terminal When Using Ctrl + \ During top Command #12625

Closed S0nG0ku0 closed 1 month ago

S0nG0ku0 commented 1 month ago

Describe the bug

When running the top command in the Zsh terminal and subsequently pressing Ctrl + \ (which sends a quit signal to the running process), the terminal display becomes garbled. Specifically, after pressing Ctrl + .

Steps to reproduce

  1. Open a Zsh terminal.
  2. Execute the top command.
  3. While top is running, press Ctrl + .

Expected behavior

Pressing Ctrl + \ should terminate the top command cleanly and return the terminal to its normal state without displaying corrupted or unrelated content.

Screenshots and recordings

No response

OS / Linux distribution

macOS Catalina 10.15.7

Zsh version

5.7.1

Oh My Zsh version

master (d6f84f3)

Terminal emulator

iTerm2

If using WSL on Windows, which version of WSL

None

Additional context

GNUSheep commented 1 month ago

Hi! I might be wrong, and not fully understand your problem, but I think it's more related to terminal itself not the shell.

Function like zoom in and out, are handled by terminal. I tested this behavior on Alacritty, Gnome terminal, and kitty, using different shells, oh my zsh, bash, sh and the results are the same. I didn't get corrupted terminal only zoomed one.

Maybe it's something wrong with your term?

S0nG0ku0 commented 1 month ago

I also use Zsh on Kitty, and it gives me the same behavior as if I ran top and pressed Enter (CTRL + \) to quit top. It looks like this after run ls -la:

Screen Shot 2024-08-19 at 8 35 45 PM
GNUSheep commented 1 month ago

Hmm very weird, I reproduced your steps and got normal output

image

carlosala commented 1 month ago

That is completely normal, and it's due to how terminals render characters. If you resize, the characters' sizes no longer fit and appear messed up. It is not due to Oh My Zsh at all.