mirror of
https://github.com/kovidgoyal/kitty
synced 2026-07-21 16:05:02 +02:00
Report the window width and height for TIOCSWINSZ
Matches behavior of xterm
This commit is contained in:
@@ -75,9 +75,9 @@ class Child:
|
|||||||
t.start()
|
t.start()
|
||||||
return pid
|
return pid
|
||||||
|
|
||||||
def resize_pty(self, w, h):
|
def resize_pty(self, w, h, ww, wh):
|
||||||
if self.child_fd is not None:
|
if self.child_fd is not None:
|
||||||
fcntl.ioctl(self.child_fd, termios.TIOCSWINSZ, struct.pack('4H', h, w, 0, 0))
|
fcntl.ioctl(self.child_fd, termios.TIOCSWINSZ, struct.pack('4H', h, w, ww, wh))
|
||||||
|
|
||||||
def hangup(self):
|
def hangup(self):
|
||||||
if self.pid is not None:
|
if self.pid is not None:
|
||||||
|
|||||||
@@ -65,7 +65,8 @@ class Window:
|
|||||||
def set_geometry(self, new_geometry):
|
def set_geometry(self, new_geometry):
|
||||||
if self.needs_layout or new_geometry.xnum != self.screen.columns or new_geometry.ynum != self.screen.lines:
|
if self.needs_layout or new_geometry.xnum != self.screen.columns or new_geometry.ynum != self.screen.lines:
|
||||||
self.screen.resize(new_geometry.ynum, new_geometry.xnum)
|
self.screen.resize(new_geometry.ynum, new_geometry.xnum)
|
||||||
self.child.resize_pty(self.screen.columns, self.screen.lines)
|
self.child.resize_pty(self.screen.columns, self.screen.lines,
|
||||||
|
max(0, new_geometry.right - new_geometry.left), max(0, new_geometry.bottom - new_geometry.top))
|
||||||
self.char_grid.resize(new_geometry)
|
self.char_grid.resize(new_geometry)
|
||||||
self.needs_layout = False
|
self.needs_layout = False
|
||||||
else:
|
else:
|
||||||
|
|||||||
Reference in New Issue
Block a user