1
1
mirror of https://github.com/wez/wezterm.git synced 2024-12-25 22:33:52 +03:00
Commit Graph

83 Commits

Author SHA1 Message Date
Wez Furlong
42f3a729a8 gui: fix OutOfTextureSpace error when scaling to large font sizes
refs: https://github.com/wez/wezterm/issues/428
2021-01-16 08:12:45 -08:00
Wez Furlong
30b262c1c0 gui: tidy up RenderState enum
Since we no longer have our fallback Software renderer (only mesa),
remove what has become an empty variant and hoist the GL state up
into RenderState, holding Option<RenderState> in the window.
2021-01-16 08:00:17 -08:00
Wez Furlong
f39c4f9d6e deps: update to mlua 0.5 2021-01-13 10:06:35 -08:00
Wez Furlong
5d360ae365 termwiz: Remove anyhow::Result from public API
It's been replaced with an opaque termwiz error type instead.

This is a bit of a more conservative approach than that in (refs: #407)
and has less of an impact on the surrounding code, which appeals to
me from a maintenance perspective.

refs: #406
refs: #407
2021-01-08 00:32:30 -08:00
Wez Furlong
697d41aeb1 Render the various underline styles
```
$ printf "\x1b[58;2;255;0;0m\x1b[4msingle\x1b[21mdouble\x1b[60mcurly\x1b[61mdotted\x1b[62mdashed\x1b[0m"
```

refs: https://github.com/wez/wezterm/issues/415
2021-01-05 23:46:15 -08:00
Wez Furlong
93576691fe compute most line-glyphs on-the-fly
We now have too many permutations to pre-render in the initial
texture size, so do this on the fly instead.

refs: https://github.com/wez/wezterm/issues/415
2021-01-05 14:16:21 -08:00
Wez Furlong
7c8f2b7445 respect new underline color when rendering
```
printf "\x1b[4m\x1b[58;2;255;0;0mred underline\x1b[0m"
```

prints "red underline" in the foreground color, with an
underline that is bright red `rgb(255, 0, 0)`.

refs: https://github.com/wez/wezterm/issues/415
2021-01-05 12:12:16 -08:00
Wez Furlong
b35f3aa199 Add Curly, Dotted, Dashed and colored underline concept to model
These aren't currently rendered, but the parser and model now support
recognizing expanded underline sequences:

```
CSI 24 m   -> No underline
CSI 4 m    -> Single underline
CSI 21 m   -> Double underline
CSI 60 m   -> Curly underline
CSI 61 m   -> Dotted underline
CSI 62 m   -> Dashed underline

CSI 58 ; 2 ; R ; G ; B m   -> set underline color to specified true color RGB
CSI 58 ; 5 ; I m           -> set underline color to palette index I (0-255)
CSI 59                     -> restore underline color to default
```

The Curly, Dotted and Dashed CSI codes are a wezterm assignment in the
SGR space.  This is by no means official; I just picked some numbers
that were not used based on the xterm ctrl sequences.

The color assignment codes 58 and 59 are prior art from Kitty.

refs: https://github.com/wez/wezterm/issues/415
2021-01-05 10:29:36 -08:00
Wez Furlong
b8cabc50bc include wezterm version in opengl init log line 2020-12-30 12:07:49 -08:00
Wez Furlong
234fe40be6 compare_and_swap -> compare_exchange
Nightly Rust (which I'm using for M1 builds) deprecates the former
so switch to the latter.
2020-12-29 16:41:55 -08:00
Wez Furlong
154ab20d0e wezterm-gui: we now start an implicit unix mux server
When running the GUI, we generate a unix domain socket path for
the current process and start up a mux server for that path.

This allows `wezterm cli list` and `wezterm cli split-pane` to
work implicitly inside the GUI session.

When started in this way, the mux server is not persistent;
when the GUI process is terminated, all of its windows, tabs
and panes are terminated.

refs: https://github.com/wez/wezterm/issues/230
2020-12-29 15:58:39 -08:00
Wez Furlong
1c0817b2b2 mux: factor out server bits to helper crate 2020-12-29 15:25:15 -08:00
Wez Furlong
cf6914c5d8 window: remove non-opengl paint, rename paint_opengl -> paint 2020-12-29 13:25:35 -08:00
Wez Furlong
cf418c34e3 window: consolidate opengl_initialize with created callback
Since we now always init opengl and fail to create a window if that
fails, may as well combine these two callbacks.
2020-12-29 12:44:39 -08:00
Wez Furlong
ec7d511750 window: implicitly enable_opengl at new_window creation 2020-12-29 12:31:25 -08:00
Wez Furlong
4c22de9f6d window: make opengl always required 2020-12-29 12:13:23 -08:00
Wez Furlong
da55e12b5e Add selection_word_boundary configuration option
refs: https://github.com/wez/wezterm/issues/405
2020-12-28 14:13:25 -08:00
Wez Furlong
94ca16d987 gui: round x-coordinate when selecting text
But don't round the y-coordinate as that one seems OK.

refs: https://github.com/wez/wezterm/issues/350
2020-12-28 13:44:30 -08:00
Wez Furlong
7cbbb49ab4 deps: ordered-float -> 2.0 2020-12-28 08:25:43 -08:00
Wez Furlong
d302f82335 window+gui: macOS: add native_macos_fullscreen_mode option
Defaults to false.  If set to true, the ToggleFullScreen action
prefers native macOS fullscreen mode.

refs: https://github.com/wez/wezterm/issues/177
2020-12-27 22:34:31 -08:00
Wez Furlong
cd997cbe48 window+gui: migrate prefer_egl to WindowConfiguration 2020-12-27 22:06:04 -08:00
Wez Furlong
228356105e window+gui: migrate enable_wayland to WindowConfiguration 2020-12-27 22:00:51 -08:00
Wez Furlong
fb53f98295 window+gui: migrate windows dead keys config to WindowConfiguration
untested as I'm on a mac, but seems like it might compile...
2020-12-27 21:56:16 -08:00
Wez Furlong
44ca61da66 window+gui: introduce WindowConfiguration trait
This adopts a similar technique to that used to pass the wezterm
config to the term crate, but this time it is for passing it to
the window crate.

The use_ime option has been ported over to this new mechanism.
2020-12-27 21:51:56 -08:00
Wez Furlong
7ae52cd2b5 wezterm: plumbing for FullScreen action
Hooks up toggling fullscreen mode on macos, with plumbing for
other systems.

I prefer not to use the "modern fullscreen" mode because I find
the transition animations in macOS are horrendously slow.

I'll make an option to allow selecting whether that is used or not
in a follow-on diff.

refs: https://github.com/wez/wezterm/issues/177
2020-12-27 19:15:47 -08:00
Wez Furlong
b438a9aa6f log::info! when clicking an URL, rather than log::error! 2020-12-26 19:20:23 -08:00
Wez Furlong
e7677aa212 suppress updater window
The new banner is less intrusive; it doesn't steal focus
and for users that have multiple wezterm processes, doesn't show
one per process.

So let's turn off the updater window.  I'm considering moving the
"smart" upgrade links into a helper subcommand, but that's for
another diff.
2020-12-26 19:17:17 -08:00
Wez Furlong
2605d63247 update checker: save latest release info, show banner on startup
This commit keeps the content from the last release check in a local
file and reads from that file on startup to set a two-line release
info banner in each new pane.
2020-12-26 19:07:52 -08:00
Wez Furlong
6b414bebc9 tweak updating checking
* Allow injecting some initial output to new panes
* Have the update checker set this new-pane-banner to a short
  upsell to let the user know there is an update.
* Refactor toast notifications into their own crate
* Have the update checker call a new stub function that triggers
  a toast notification with an URL... but it does nothing because
  the rust ecosystem doesn't support this on macos yet and I'm
  writing this code there
2020-12-26 18:22:44 -08:00
Wez Furlong
586d18c9fd QuitApplication now respects window_close_confirmation
closes: https://github.com/wez/wezterm/issues/398
closes: https://github.com/wez/wezterm/issues/280
2020-12-26 15:37:41 -08:00
Wez Furlong
b3ac77aa92 wezterm: allow adding images to termwiztermtab apps
Tidies up the plumbing around pixel dimensions so that ImageData
can be rendered via the termwiztermtab bits.

I put this together to play with sticking the wezterm logo in
the close confirmation dialogs.  I didn't end up using that though,
but have preserved the commented code for use in future hacking.
2020-12-26 14:01:48 -08:00
Wez Furlong
1aeabba79f Add confirmation to QuitApplication action
refs: https://github.com/wez/wezterm/issues/280
2020-12-25 18:20:58 -08:00
Wez Furlong
c66e8f5c5e use $WEZTERM_LOG to configure log levels ad-hoc
80214319ae broke the use of RUST_LOG to
turn up trace logging.

This commit refactors logger initialization into the env-bootstrap crate
so that it is centralized, and adopts the use of `WEZTERM_LOG` to
override the default logging filters, rather than `RUST_LOG`.
2020-12-23 12:19:19 -08:00
Wez Furlong
286bc1c8ec cargo fmt 2020-12-23 11:41:12 -08:00
Wez Furlong
3d81740a04 wezterm: refactor close confirmations
Make pane, tab, window close confirmations use the same core function.

Make that function accept mouse input so that closing the window with
a mouse click doesn't require switching to the keyboard to confirm
the close.

refs: #280
2020-12-23 11:37:23 -08:00
Wez Furlong
5787bdff53 wezterm: closing a window now prompts for confirmation by default
Adds `window_close_confirmation = "AlwaysPrompt"` as the default
configuration.  Can be set to `NeverPrompt` to disable prompting.
2020-12-23 09:58:38 -08:00
Wez Furlong
bcaba72472 adjust log level for debug_key_events output 2020-12-22 11:35:17 -08:00
Wez Furlong
61ce4cd954 fixup some more log levels 2020-12-21 22:13:41 -08:00
Wez Furlong
80214319ae adjust log levels
Revise logging so that we use info level for things that we want
to always log, and adjust the logger config to always log info
level messages.

That means shifting some warning level logs down lower to debug level so
that they aren't noisy.

closes: https://github.com/wez/wezterm/issues/388
2020-12-20 22:01:06 -08:00
Wez Furlong
0ae494fb94 config: add line_height config option
The default is 1.0.  `line_height` is used to scale the effective
cell height, increasing the amount of space between font baselines.

refs: https://github.com/wez/wezterm/discussions/387
2020-12-20 14:33:18 -08:00
Wez Furlong
eb83f28810 deps: dirs -> dirs_next
I saw that former is unmaintained, and dependabot wants
to upgrade that one.
2020-12-10 10:08:49 -08:00
Wez Furlong
c1fa08319e deps: upgrade euclid -> 0.22 2020-12-10 10:03:30 -08:00
dependabot[bot]
b56606e9cb build(deps): bump http_req from 0.6.1 to 0.7.1
Bumps [http_req](https://github.com/jayjamesjay/http_req) from 0.6.1 to 0.7.1.
- [Release notes](https://github.com/jayjamesjay/http_req/releases)
- [Commits](https://github.com/jayjamesjay/http_req/compare/v0.6.1...v0.7.1)

Signed-off-by: dependabot[bot] <support@github.com>
2020-12-10 10:01:53 -08:00
Wez Furlong
30ff3d6542 fixup build for macos after notify_rust updates 2020-12-09 14:30:18 -08:00
Wez Furlong
1635576413 deps: update notify-rust to 4 2020-12-09 14:19:07 -08:00
Wez Furlong
526df72544 textwrap -> 0.13 2020-12-09 14:07:35 -08:00
Wez Furlong
8eb0dac92c Update lru -> 0.6 2020-12-09 14:04:56 -08:00
Wez Furlong
22b4e99c82 tidy up default_dpi vs DEFAULT_DPI
This commit breaks the dependency from config -> window,
which in turn breaks the dependency from mux-server -> x11 libs
on linux.
2020-12-09 13:48:23 -08:00
Wez Furlong
92827a1bea wezterm: default dpi on macOS is now 72
https://wiki.lazarus.freepascal.org/Cocoa_DPI states that the dpi
on macOS is 72.  That matches up to the experimental results reported
in #332 (in which 74.0 appears about the right size).

This commit introduces a `DEFAULT_DPI` constant that is set to 72 on
macOS and 96 on other operating systems.

The result of this is that a 10 point Menlo font now appears to be
the same size in Terminal.app and WezTerm.app.

refs: https://github.com/wez/wezterm/issues/332
2020-12-06 18:34:06 -08:00
Wez Furlong
19843ba8f3 wezterm-gui: fixup compilation 2020-12-06 14:30:45 -08:00