1
1
mirror of https://github.com/wez/wezterm.git synced 2024-12-01 17:35:50 +03:00
Commit Graph

127 Commits

Author SHA1 Message Date
Wez Furlong
aee37784e5 Windows: fix initial window size when display scaling != 100%
The heart of this issue was that the resize callbacks have two
layers of state; one in the low level window and one in the application
level window.

On Windows, the system triggers the low level callback prior to
opengl being initialized.  Since the application level depends on
the opengl state, there are some code paths where it NOPs and
returns early if opengl isn't yet initialized.

When the system-wide display scaling is set to say 200%, the application
layer can't know the effective DPI of the window it is creating because
it doesn't know which monitor will be used or what its DPI will be.

New windows are created at the default DPI of 96, and we rely on the
resize events to detect the actual DPI and adjust the scaling in
the window.

The early call of the resize callback meant that the low level and
application level size/dpi state was out of sync and the result was
that the window had half as many pixels as it should, but that the
terminal model was still sized as though it had the correct amount
(twice as many as visible).  This resulted in the window being too
small for the viewport.

The resolution is simple: we now suppress emitting the resize processing
until opengl has been initialized.

The test scenario for this is:

* Set system scaling to 100%
* Launch wezterm
* Set system scaling to 200%
* Observe that wezterm scales to match
* Press CTRL-SHIFT-N to spawn a new window
* Observe that the new window size matches the other window (previously
  this one would be half the size)

While I was looking at this, I noticed that the manifest didn't
match the DPI awareness that we have in the code, so update that.

refs: https://github.com/wez/wezterm/issues/427
2021-01-18 09:27:04 -08:00
Wez Furlong
3c3ba6a30a icon: add padding to mac icon
Converts the svg font to a path so that rendering doesn't
require the full Operator Mono font locally.

Adjust the update script to add 10% padding around the icon
on macOS as @erf suggests that the increased padding looks
better/more consistent with other macOS apps.
2020-12-26 17:08:38 -08:00
Wez Furlong
404844522c wezterm: update icon
I was playing around with inkscape and this simple icon is
the result.

Add a script to generate the various bitmap icons for all three
platforms.  It is intended to run on a Linux host.
2020-12-26 01:49:40 -08:00
Wez Furlong
3bd8d8c845 wezterm-font: bundle a last resort font
Bundle the *Last Resort High-Efficiency* font from
https://github.com/unicode-org/last-resort-font/
version 13.001 (Oct 22 2020).

This provides a more useful fallback glyph than we'd otherwise
produce if there is no matching glyph in any of the fonts.

Its license is OFL-1.1 which is compatible with the other
bundled fonts.
2020-11-22 16:12:20 -08:00
Wez Furlong
eb22808761 wezterm: add shell integration for bash and zsh
This commit provides a shell script that hooks into bash and zsh
to enable OSC 7 and semantic zones.

The packaging for Fedora and Debian deploys that script to
/etc/profile.d.
2020-11-14 09:07:56 -08:00
Wez Furlong
fc24528f21 wezterm: update conpty and openconsole
These were build from this version: https://github.com/microsoft/terminal/releases/tag/v1.4.3141.0
2020-11-12 22:06:02 -08:00
Wez Furlong
5b9c86d836 colors: set cursor border to bg in the color schemes
This avoids having a green (by default) border around the cursor.
The dynamic color escape sequences have been updated to also
change the border color when the cursor background color is changed.
2020-10-27 09:17:20 -07:00
Wez Furlong
83d604fe29 wezterm: .desktop launches wezterm
I changed this to `wezterm-gui` thinking it would be a hair more
efficient, but it makes it difficult to access the cli side of
things from the appimage.
2020-10-24 23:25:48 -07:00
Wez Furlong
89257c73bb wezterm: a few more wezterm-gui fixups
These parts of packaging are likely sensitive to the change also
2020-10-24 17:17:45 -07:00
Wez Furlong
2ec12b5426 wezterm: fixup packaging for wezterm-gui split
refs: #301
2020-10-24 16:54:36 -07:00
Wez Furlong
95ab1b34e1 Update color schemes
Sync with 0966005b77
2020-10-19 22:51:48 -07:00
Wez Furlong
2c0c89a97b Windows: update openconsole.exe
Built from 90452664ff

This seems to make mouse wheel scrolling work more reliably for me in
vim/wsl.
2020-10-17 20:15:52 -07:00
Wez Furlong
b7e303f39c Windows: prefer to use Direct3D11 via ANGLE
This is similar in spirit to the work in 4d71a7913a
but for Windows.

This commit adds ANGLE binaries built from
07ea804e62
to the repo.  The build and packaging will copy those into the same
directory as wezterm.exe so that they can be resolved at runtime.

By default, `prefer_egl = true`, which will cause the window
crate to first try to load an EGL implementation.  If that fails,
or if `prefer_egl = false`, then the window crate will perform
the usual WGL initialization.

The practical effect of this change is that Direct3D11 is used for the
underlying render, which avoids problematic OpenGL drivers and means
that the process can survive graphics drivers being updated.

It may also increase the chances that the GPU will really be used
in an RDP session rather than the pessimised use of the software
renderer.

The one downside that I've noticed is that the resize behavior feels a
little janky in comparison to WGL (frames can render with mismatched
surface/window sizes which makes the window contents feel like they're
zooming/rippling slightly as the window is live resized). I think this
is specific to the ANGLE D3D implementation as EGL on other platforms
feels more solid.

I'm a little on the fence about making this the default; I think
it makes sense to prefer something that won't quit unexpectedly
while a software update is in progress, so that's a strong plus
in favor of EGL as the default, but I'm not sure how much the
resize wobble is going to set people off.

If you prefer WGL and are fine with the risk of a drive update
killing wezterm, then you can set this in your config:

```lua
return {
  prefer_egl = false,
}
```

refs: https://github.com/wez/wezterm/issues/265
closes: https://github.com/wez/wezterm/issues/156
2020-10-17 19:08:16 -07:00
Wez Furlong
4d71a7913a macOS: bundle and use MetalANGLE to enable Metal rendering
This commit adjusts the window layer to have it try to load EGL
implementations on macOS.  This is important as the system
provided OpenGL implementation is deprecated and I wanted to
have a path forward for when it is finally removed.

If EGL fails to initialize, we fall back to the CGL/OpenGL
implementation that we used previously.

I've included binaries built for 64-bit intel from the MetalANGLE
project; here's how I built them:

```
git clone https://chromium.googlesource.com/chromium/tools/depot_tools.git --depth 1
git clone https://github.com/kakashidinho/metalangle --depth 1
cd metalangle
PATH=$PWD/../depot_tools:$PATH python scripts/bootstrap.py
PATH=$PWD/../depot_tools:$PATH gclient sync
PATH=$PWD/../depot_tools:$PATH gn --args="is_debug=false angle_enable_metal=true angle_enable_vulkan=false angle_enable_gl=false angle_build_all=false" gen out/Release
PATH=$PWD/../depot_tools:$PATH autoninja -C out/Release
```

Those steps are a little too long to want to put them directly
into the wezterm CI.

It is important for metalangle to be >= 8230df39a5
in order for scaling to be handled correctly when dragging windows
between monitors.

refs: https://github.com/kakashidinho/metalangle/issues/34
2020-10-17 09:34:01 -07:00
Wez Furlong
e6a858664f windows: Software frontend is now mesa llvmpipe
This is a bit of a switch-up, see this comment for more background:
refs: https://github.com/wez/wezterm/issues/265#issuecomment-701882933

This commit:

* Adds a pre-compiled mesa3d opengl32.dll replacement
* The mesa dll is deployed to `<appdir>/mesa/opengl32.dll` which by
  default is ignored.
* When the frontend is set to `Software` then the `mesa` directory
  is added to the dll search path, causing the llvmpipe renderer
  to be enabled.
* The old software renderer implementation is available using the
  `OldSoftware` frontend name

I'm not a huge fan of the subdirectory for the opengl32.dll, but
I couldn't get it to work under a different dll name; the code
thought that everything was initialized, but the window just rendered
a white rectangle.
2020-10-01 18:31:57 -07:00
Wez Furlong
3413bd97b9 wezterm: bundle JetBrains Mono and Noto Color Emoji fonts
These serve two purposes:

* Provide a consistent default font for new installations,
  that happens to show off ligature and color emoji support
  out of the box.
* Provide a reasonable fallback in case the configuration is broken

Both fonts are distributed under the terms of the OFL 1.1.

refs: https://github.com/wez/wezterm/issues/263
2020-09-29 22:05:18 -07:00
Wez Furlong
d23156403d Re-sync color schemes 2020-07-18 09:29:50 -07:00
Wez Furlong
f64b268edd Update openconsole.exe
refs: https://github.com/wez/wezterm/issues/244
refs: https://github.com/wez/wezterm/issues/243
2020-07-17 09:41:42 -07:00
Wez Furlong
77c5220f59 wezterm: sync with new themes from iterm2colorschemes.com
This is a sync with the themese as of
eeded52088
2020-06-20 18:54:19 -07:00
Wez Furlong
3468896ec1 wezterm: generate version info resource at build time
Bake in the git version info
2020-05-25 12:36:29 -07:00
Wez Furlong
61e3545c68 pty: windows: allow loading a newer conpty dll
This commit allows loading the console functions from `conpty.dll`
instead of `kernel32.dll` which means that we can update and
track newer features than have been deployed to Windows.

In practical terms this means that we can now unlock mouse input
reporting in eg: VIM running under WSL.
refs: https://github.com/microsoft/terminal/issues/376

We're jumping the gun on this issue, which is tracking making
a proper supportable way to deploy this sort of update:
refs: https://github.com/microsoft/terminal/issues/1130

For now it seems easier just for us to bundle our own copy of
these bits.

This includes a speculative change to include those in our
Windows downloads also.

The binaries were built from
4f8acb4b9f
2020-04-06 12:48:54 -07:00
Wez Furlong
cb89ec73e3
First pass at building an AppImage (#125)
refs: https://github.com/wez/wezterm/issues/124
2020-01-20 23:11:38 -08:00
Wez Furlong
2d50a17466 Import color schemes from https://github.com/mbadolato/iTerm2-Color-Schemes
These are current as of revision d7023ef0810a92a38569be86bbf0c02536c29e3f
2020-01-12 20:51:03 -08:00
Wez Furlong
cdc77840b7 Add wezterm.desktop file to the debian package
This makes it a bit more convenient to launch wezterm, especially
on eg: a chromebook
2019-11-20 06:37:32 +00:00
Wez Furlong
c8f34aa81b windows: use application icon in window title bar 2019-11-04 08:09:52 -08:00
Wez Furlong
a56f37598c Embed icon into windows executable and titlebar
This also applies to X11 when using the glutin frontend
2019-03-24 19:08:07 -07:00
Wez Furlong
67a57f12af Add basic install script and icon
The icon comes from "Smoothicons 7" by Corey Marion which I found
as a royalty free icon searching the internet.  I would love to
have a purpose built icon, but this is sufficient for now.

The install script sets up a macOS application bundle that references
the generated wezterm binary and the icon.  The same technique could
be used to generate a .desktop file for linux.

I've changed the default-prog on macos to be `login -pf $USER` as
that is a better default experience on macOS.
2019-03-23 18:41:10 -07:00