Skip to content

Ghostty crashes when window is resized to zero #4

Closed

Description

@almonk
Screen.Recording.2022-08-09.at.16.19.22.mov

Fun reproduceable bug on macOS 12.5. If you resize the window to nothing, ghostty crashes with the following debug output:

rows = 0 }, cell=Grid.CellSize{ .width = 9.0e+00, .height = 1.7e+01 }
thread 2635598 panic: integer overflow
/Users/alasdairmonk/Apps/ghostty/src/terminal/Screen.zig:695:27: 0x102cfc2ff in terminal.Screen.resize (ghostty)
            self.cursor.y -= self.rows - rows;
                          ^
/Users/alasdairmonk/Apps/ghostty/src/terminal/Terminal.zig:234:31: 0x102cd9837 in terminal.Terminal.resize (ghostty)
        try self.screen.resize(alloc, rows, cols);
                              ^
/Users/alasdairmonk/Apps/ghostty/src/Window.zig:402:24: 0x102cd9e97 in .glfw.Window.CWrapper.sizeCallbackWrapper (ghostty)
    win.terminal.resize(win.alloc, win.grid.size.columns, win.grid.size.rows) catch |err|
                       ^
???:?:?: 0x102e9a567 in __glfwInputWindowSize (???)
???:?:?: 0x1031f7fa7 in -[GLFWWindowDelegate windowDidResize:] (???)
???:?:?: 0x1906cd51b in ??? (???)
???:?:?: 0x5751800190771c17 in ??? (???)
???:?:?: 0x755e000190771b83 in ??? (???)
???:?:?: 0x540980019069c1bf in ??? (???)
???:?:?: 0x8f1a800191561c97 in ??? (???)
???:?:?: 0x5012000193291207 in ??? (???)
???:?:?: 0x46080001935bc857 in ??? (???)
???:?:?: 0x2c590001934af6cb in ??? (???)
???:?:?: 0x56338001934af40b in ??? (???)
???:?:?: 0xb35000019353af8b in ??? (???)
???:?:?: 0xf71f00019343bd7f in ??? (???)
???:?:?: 0x7e4a0001933af0ff in ??? (???)
???:?:?: 0x3a3a8001933ae50b in ??? (???)
???:?:?: 0x8b500001933ad4b3 in ??? (???)
???:?:?: 0x2b1b0001031f1e5b in ??? (???)
???:?:?: 0x102ea3137 in _glfwWaitEvents (???)
/Users/alasdairmonk/Apps/ghostty/vendor/mach/glfw/src/main.zig:414:21: 0x102cb5b6b in App.run (ghostty)
    c.glfwWaitEvents();
                    ^
/Users/alasdairmonk/Apps/ghostty/src/main.zig:81:16: 0x102cb4833 in main (ghostty)
    try app.run();
               ^
/usr/local/bin/lib/zig/std/start.zig:576:37: 0x102cb60bb in std.start.main (ghostty)
            const result = root.main() catch |err| {
                                    ^
???:?:?: 0x10381508b in ??? (???)
???:?:?: 0x2530ffffffffffff in ??? (???)
[1]    94153 abort      zig-out/bin/ghostty

Activity

  1. mitchellh commented on Aug 9, 2022

    @mitchellh
    Contributor

    I like how it just poofs out like you set it to zero and its like "BYE". lol.

  2. added a commit that references this issue on Mar 3, 2026
  3. added a commit that references this issue on Sep 14, 2026
  4. added a commit that references this issue on Oct 7, 2026
  5. added a commit that references this issue on Oct 27, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions