-
Notifications
You must be signed in to change notification settings - Fork 535
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Customize initial size for quick terminal #2384
Comments
We have a precedent for supporting multiple units within a single config, so my preference would be something like the following:
Example valid values:
Thoughts? |
It is macOS only. |
Sounds good to me. This approach is simple enough to allow configuration on one dimension by default, while remaining flexible enough to support full customization of both axes. My only feedback would be that mixing units feels a bit unintuitive but I’m not opposed to it at all, especially since we already have existing precedents for handling mixed units. |
I agree, I'd hope people don't do it, but I don't see a reason to outright reject it. |
I should add: I imagine people will want different aligned quick terminals too. My proposal with |
Marking this as accepted, if someone wants to PR it as proposed I will accept it. I'm still open to further feedback though. |
Quick question: Should the parsing and validation of |
It should go in |
Good call on And...
Agreed on that part, I think unless it turns out to be super easy to implement multi-value, the initial implementation can be single value only, and then multi-value support later on. As for mixing units, The only other thing I'd suggest as part of this... unless I missed something, the docs don't explicitly mention that this is a macOS only feature. So I'd also suggest updating the docs somewhere to make that part explicit. |
I thought I put it for the |
We talked about this briefly on Discord in the context of a maximum quick terminal width, but for height as well being able to specify the number of display rows would be nice. |
For the initial work I suggest just doing % and pixels. Rows/columns can come later since the API around that is messier. |
Making a start on this, by defining that new dedicated The initial implementation is only 1 dimensional, but as we've said, we can make it 2 dimensional later if we want to. I'm still super new to Zig, so I've spent a lot of time figuring out how to even get this working. I'm expecting a lot of this code is not at all idiomatic. But the tests pass... so I think this part at least works. Unless this needs major changes, the remaining work is on the macOS side. I don't know when I'll have time to do any further work, so if anybody wants to pick up what I've got so far and run with it, please feel free! |
Building on d2cf51a, I added the frontend macOS stuff so I can hardcode my own use case (fullscreen). Unfortunately my naive attempts at using https://github.com/futurepaul/ghostty/commit/66afff7988eb32498fc2a9641b0d359cfdba9007 |
Nice! As may have been obvious... I just didn't have the time to finish what I was doing on this 😂 So remaining tasks as I see it:
|
🤝 After playing with my version more I realized it was going off the screen on the bottom. https://github.com/futurepaul/ghostty/commit/8f70f8a2bd464a37df617c497362a7a26ba10610 Getting the height from
|
# Description This commit introduces the ability to launch the quick terminal in the middle position. ![Screen Recording 2024-12-24 at 14 59 46](https://github.com/user-attachments/assets/6c733caf-34c7-4e80-ba16-24b41f98d2f0) ## Note to reviewer - The quick terminal is currently centered. Should we consider adding a top offset to better align with the screenshot in [the issue](#2494 )? Should it be configurable? - On large monitors, half the visible frame might be excessively large. To mitigate, I am planning to implement #2384 but we should probably agree on a good default maximum width/height in middle position. - I also figured out, reloading the configuration does not update the quick terminal configuration. That is also an issue I will try to fix. Resolves #2494 I agree to relicense my commit to MIT.
This commit introduce `quick-terminal-size` option which allows to define the size of the quick terminal. It also fixes an issue where the quick terminal position was not properly updated when reloading the configuration. Resolves ghostty-org#2384
This commit introduce `quick-terminal-size` option which allows to define the size of the quick terminal. It also fixes an issue where the quick terminal position was not properly updated when reloading the configuration. Resolves ghostty-org#2384
I see the PR is in flight, so maybe preaching to the choir but I would strongly appreciate some ability to dial in quick-terminal width when in top b/c I use a 49" ultrawide (LG 49WL95C-W) and the ergonomics for (cf iTerm: and center is ... okay: (but [if anyone is wondering, Safari was being weird about previewing the image uploads; that's why it gets replaced by arc between screenshot 1 and 2) |
Alas, having chosen to rebase and build first, read Swift later, I discover that even with the 2 number forms of
(and the other 2 versions) I suppose the ~problem is that [either you could still default to center OR] you need an additional config here (or a 4 number format?) to specify not only per-se width but also offset from edge |
Umm, so ... I opened #4716 as a draft PR because it does contain a partial implementation that I probably plan to continue on. (and I originally was just gonna make a gist of a patch or indeed a but then I also got a little carried away and wrote, in order, 3 more lengthy comments:
I… don't really think those are in the right place but I also don't know that they could be moved at this point and make sense (but mitchell or any other project admin types, feel free to do so anyway if you disagree) I also think I'm burned out on thinking about this for the day or at least the next several hours, so … I wanted to go ahead and point these out to potentially interested parties before I give computing a break. Cheers 😅 |
In macOS, it looks like we're setting the default sizes here:
https://github.com/ghostty-org/ghostty/blob/main/macos/Sources/Features/QuickTerminal/QuickTerminalPosition.swift#L10-L29
For example, when showing at the top of the screen, we're setting the height to be 1/4 the height of the screen.
(specifically, this is whichever screen quick terminal first loads on. there's some edge cases around quick-terminal-screen=mouse if you have monitors of varying sizes, which I'm not going to go into right now)
I couldn't figure out from https://github.com/ghostty-org/ghostty/pull/2320/files how this is implemented on other systems. Am I missing something, or is this a macOS-only feature for now?
There are two options we could go for here:
(plus the option of both)
In my case, I would want my multiplier to be 1. i.e. the quick terminal takes up the entire screen. For my specific example, I see no value in specifying a fixed height. My instinct is that most people who use quick terminal have a preference for it to fill "a bit of the screen", "a lot of the screen" or "all of the screen". I imagine pixel-precision sizing of the quick terminal would be a niche desire.
(I could of course be wildly wrong these assumptions)
So were I to implement this myself (and I'm thinking I probably will), my proposal is:
quick-terminal-size-multiplier
, with default value of 0.25height: screen.frame.height * multiplier
There are a few edge cases I'd have to consider (e.g. making sure the multiplier is > 0, and <= 1), but otherwise this feels like it would be a fairly simple thing to implement.
If you're happy with the proposed implementation, I might get a PR raised for it over the weekend.
The text was updated successfully, but these errors were encountered: