This causes a functional change that may not be obvious.
When running `cosmic-term` from a shell prompt as a detached
process, `stdout`/`stderr` descriptors get deleted, and a `println!()`
message would take the `cosmic-term` process down.
No such an issue with log messages.
This can be tested by running `htop` then exiting the tool, which
would trigger a "TODO: CursorBlinkingChange" message.
Signed-off-by: Mohammad AlSaleh <CE.Mohammad.AlSaleh@gmail.com>
This can happen if configured font name is uninstalled for example.
Pick the first font name available if that's the case.
Signed-off-by: Mohammad AlSaleh <CE.Mohammad.AlSaleh@gmail.com>
* Store a font name => font faces map
* Only list font names that have `NORMAL` and `BOLD` faces with
`Normal` stretch. This will give us defaults and fall-backs that are
guaranteed to always exist.
* Filter by stretch first, with `Normal` chosen as the always existing
default.
* Then only list font weights supported by the font name stretch
selected, for the normal and bold cases.
* When changing the font name selected, the stretch/weight options
will stay the same if supported by the new font name, or revert to
the always existing fall-backs.
Signed-off-by: Mohammad AlSaleh <CE.Mohammad.AlSaleh@gmail.com>
In `Application::subscription()`, `subscription::channel()` would
create a dead terminal tab if it was called before
`config_subscription()`.
Then `subscription::channel()` would be triggered a second time
creating a second terminal tab that works.
This commit fixes this issue by only creating the first terminal
tab after a `Message::Config{}` was handled, i.e. after
`config_subscription()` was run.
Signed-off-by: Mohammad AlSaleh <CE.Mohammad.AlSaleh@gmail.com>