Wezterm: Remember size and position on startup

Created on 21 Aug 2020  路  2Comments  路  Source: wez/wezterm

Is your feature request related to a problem? Please describe.
I'm always frustrated when I close wezterm and when I start it back up it doesn't remember the size and location of where it last was

Describe the solution you'd like
A default behavior of remembering the position of the window would be nice, not sure how to handle the size since it can be coded in the settings... which takes precedence?

enhancement

Most helpful comment

There's a lot of complexity here; as there can be multiple windows there would need to be a way to somehow identify each of them and remember their individual positions. I can see this feature being annoying if you had a lot of windows open and had them auto-restore.

Another aspect of this is that some people start one wezterm process per window and others run one wezterm process with multiple windows. I'm not sure this feature would be compatible with that workflow.

And finally: what would get restored in the windows? Each window can have multiple tabs running a variety of programs. Would those get restored? Restoration would be weird as there is no session resumption protocol for arbitrary programs, and some of those might be dangerous; say for example something spawned a new tab running rm -rf /some/dir. That would likely be dangerous or at best unwanted if that got run when you opened the terminal!

Such a headache!

Can we reduce the scope of this request? Would it be valid to offer startup positioning options in the config file? We already allow setting the default size. It doesn't seem unreasonable to add some positioning related options. For example, allow specifying x/y position in pixels and/or percentage of screen size, and likewise expand the size options to also allow pixels and percentage of screen size.

All 2 comments

.. as well as maximization/tiling mode

  • unmaximized - the unmaximized sz/pos needs to be saved regardless of being set to tiling states
  • maximized
  • left tiled
  • right tiled

The difficulty here will be how to make it so that it is OS/window-manager/compositor independent.

There's a lot of complexity here; as there can be multiple windows there would need to be a way to somehow identify each of them and remember their individual positions. I can see this feature being annoying if you had a lot of windows open and had them auto-restore.

Another aspect of this is that some people start one wezterm process per window and others run one wezterm process with multiple windows. I'm not sure this feature would be compatible with that workflow.

And finally: what would get restored in the windows? Each window can have multiple tabs running a variety of programs. Would those get restored? Restoration would be weird as there is no session resumption protocol for arbitrary programs, and some of those might be dangerous; say for example something spawned a new tab running rm -rf /some/dir. That would likely be dangerous or at best unwanted if that got run when you opened the terminal!

Such a headache!

Can we reduce the scope of this request? Would it be valid to offer startup positioning options in the config file? We already allow setting the default size. It doesn't seem unreasonable to add some positioning related options. For example, allow specifying x/y position in pixels and/or percentage of screen size, and likewise expand the size options to also allow pixels and percentage of screen size.

Was this page helpful?
0 / 5 - 0 ratings