feat(cli): add --window-size flag for initial window dimensions#797
Open
HermeticOrmus wants to merge 1 commit into
Open
feat(cli): add --window-size flag for initial window dimensions#797HermeticOrmus wants to merge 1 commit into
HermeticOrmus wants to merge 1 commit into
Conversation
cosmic-term has no equivalent of `xterm -geometry` or `alacritty --dimensions`, so users triggering scripts via keyboard shortcuts can't pre-size the window. UI resizes don't persist across launches either. `--window-size <WxH>` (e.g. `1280x720`) sets the initial window size in logical pixels, threading through libcosmic Settings::size before first paint. Bare basenames like `0x100` or `foo` exit with a clear message. Closes pop-os#771.
Member
|
The PR template is mandatory |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why
cosmic-termhas no equivalent ofxterm -geometryoralacritty --dimensions— users triggering terminals from keyboard shortcuts or scripts can't pre-size the window, and UI resizes don't persist across launches. This is the ask in #771.What changed
src/main.rsgains a--window-size <WxH>flag (e.g.--window-size 1280x720), parsed fromclap_lexalongside the existing--working-directoryand--no-daemonhandling.When set, the value threads through libcosmic's
Settings::size(iced::Size::new(width, height))beforecosmic::app::run, so it takes effect on first paint. When unset, behavior is unchanged (libcosmic default of 1024x768).Both lower- and uppercase separator (
x/X) accepted. Floating-point dimensions accepted. Invalid input (missing separator, non-numeric, zero, negative) exits with a one-line error.How to test
Notes
--geometrywas considered butxterm's geometry syntax (WxH+X+Y) implies position support, which would need a separate libcosmic API; staying with--window-sizekeeps the scope honest.iced::Size), so the flag composes correctly withCOSMIC_SCALE.Closes #771.