Hyper: Default rows and cols?

Created on 15 Jul 2016  路  11Comments  路  Source: vercel/hyper

_Apologies if this is already documented somewhere, but I did search around a bit and read some of the code before opening this issue._

First off: 馃憤馃憤馃憤 Very well done. 馃惔 馃弴

140x30 is my preferred default terminal size and I cannot seem to find the setting in my ~/.hyperterm.js configuration file that I should modify to change the default terminal size.

Most helpful comment

going with option 1 for now. PR submitted

All 11 comments

This is mentioned in #27, thinking about doing a PR for this.

This is related to, but distinctly different from #27. In my own case I don't want HyperTerm to remember the window size. I want every window to always start at the same size, regardless of if I have resized the last window when I closed it.

Thinking about how to implement this, because it is a tad bit tricky with electron. The way it works is you create a new browser window and set the width/height. Then, the term itself will determine how many cols/rows it has based on its own size inside the browser window. So, here are few ways to handle this:

  1. Config option for default browser size, expressed in pixels. Not very "term"-like, but it is easy to implement.
  2. Try to calculate cols/rows -> pixels on window creation. This is the _ideal_ implementation, though it is difficult to determine the ending size of the window. Things like fontSize padding margin borders need to be taken into consideration.
  3. Calculate cols/rows -> pixels when main component mounts then resize window. This would make it much easier to calculate the target window size since we can work with the DOM, but then there is a noticeable delay from window creation to component mount which isn't exactly pretty.

Thinking about option 3 some more, it would be possible to use electron's ready-to-show event on the window, but then there would be nothing showing until the rows/cols can be calculated.

@rauchg I haven't done a whole lot with electron, wondering if you have any insight on an implementation for having default rows/cols?

馃憤

@tamagokun I think 1st option would be enough at this moment, so we will be able to adjust pixels ourselves

going with option 1 for now. PR submitted

Awesome! Thanks @tamagokun 馃挴

Great work here. :)

I'd also like to voice support for defining the default size in terms of columns/rows. GNOME Terminal and the macOS Terminal both support this. I wonder how they achieve this?

Maybe we need a system service / agent that calculates the target width/height based on the selected font and size in the background, prior to hyperterm launching?

What if we calculate it and cache the value based on the font/size and columns/rows? So the first launch is slightly slower, but every launch after that is not any slower?

Fixed by #257

For specifying default size in terms of columns/rows, see #430

Was this page helpful?
0 / 5 - 0 ratings

Related issues

cilice picture cilice  路  3Comments

stan-stripe picture stan-stripe  路  3Comments

legomushroom picture legomushroom  路  3Comments

aem picture aem  路  3Comments

eoinmurray picture eoinmurray  路  3Comments