1
1
mirror of https://github.com/wez/wezterm.git synced 2024-12-21 04:11:44 +03:00
Commit Graph

209 Commits

Author SHA1 Message Date
Wez Furlong
ad2f724416 bump some versions 2020-01-09 22:39:34 -08:00
Wez Furlong
94cac23df9 Workaround daemonize bug
refs: https://github.com/knsd/daemonize/pull/39
2020-01-05 20:55:28 -08:00
Wez Furlong
d79455c2b4 switch most of the rest of the mux over to the new model
This mostly works, but has a cache invalidation issue wrt.
passing invalidated rows from the server to the client...
sometimes.

However, scrollback is cached on demand and selection works.
2020-01-05 14:37:17 -08:00
Wez Furlong
60e05dbe95 add RangeSet type
The idea is to use this to maintain a set of dirty StableRowIndex
values for the mux rpc.
2020-01-05 14:37:17 -08:00
Wez Furlong
e4fed76bd1 instrument painting and rpc calls 2020-01-05 14:37:17 -08:00
Wez Furlong
12b537d2c8 serde_derive -> serde with derive feature 2020-01-05 14:37:17 -08:00
Wez Furlong
a251c3722b Enable GH actions build caching
We need to build in release mode so targets are cacheable.
GH has a limit of 400MB per cache blob and we're at 750MB with
the debug build.  Slim it down a bit.

The cache wants to hash the Cargo.lock file so I've removed that
from the ignore file and added it to the repo.  This might cause
an error for users checking out the repo after this change is
pushed; removing the local Cargo.lock should resolve that.
2019-12-29 13:09:18 -08:00
Wez Furlong
d4fcd9432a remove unused rayon dep 2019-12-15 15:32:22 -08:00
Wez Furlong
9a2c7a1485 failure -> anyhow + thiserror 2019-12-14 21:43:05 -08:00
Wez Furlong
ad72362cbc eliminate dep on rental
Trading a lot of gross for a single line of gross
2019-12-11 21:40:07 -08:00
Wez Furlong
f89b52e53e fonts: add a basic font parse using allsorts
Refs: https://github.com/wez/wezterm/issues/66
2019-12-09 18:08:02 -08:00
Wez Furlong
ab86eb1c75 font-kit: enable its use on macos
FontKit is still broken, but FontKitAndFreeType works
2019-12-08 17:51:01 -08:00
Wez Furlong
1e9d3571ba font-kit: add font_dirs configuration option
This is another option to help with the portable wezterm on a flash
drive use case.

When the font system is set to FontKitAndFreeType, the set of
directories specified by the `font_dirs` configuration option will
be scanned for fonts and used as a source for fonts.

In addition, any relative paths in the the `font_dirs` list will
be expanded relative to the configuration file path.

That allows deploying the following set of files to the root of
a flash drive:

* wezterm.exe
* wezterm.toml
* fonts/myfont.ttf

and with this config snippet:

```
font_system = "FontKitAndFreeType"
font_dir = ["fonts"]
```

wezterm will now consider myfont.ttf when loading fonts.

Refs: https://github.com/wez/wezterm/issues/73
2019-12-08 16:34:17 -08:00
Wez Furlong
8ae136e616 fonts: allow using font-kit as a source for fonts
This commit adds two new font system variants that are currently
implemented only on Windows:

* FontKit - uses fontkit both for font discovery and rasterizing
* FontKitAndFreeType - uses fontkit for font discovery but freetype
  for rasterizing

To a certain extent, FontKitAndFreeType obsoletes FontLoaderAndFreeType
and I'll be looking at removing it once I can test the build on macOS.

The FontKit impl has bad metrics and also crashes during shaping
on Windows, so it's not ready to be used by default.
2019-12-08 16:02:04 -08:00
Wez Furlong
b47cd72853 Windows: show toast notification if config reload encounters error
This gives us a way to show notifs on windows, which is a feature
that isn't supported by the notify-rust crate.
2019-12-08 11:14:02 -08:00
Wez Furlong
cdfd77902a update ssh2 dep 2019-12-08 10:43:55 -08:00
Wez Furlong
5b6bad2c51 downrev notify-rust dependency
SOmething on the CI doesn't like it and it looks like a problem
with that alpha version, so let's go back to their stable rev.
2019-12-04 20:40:32 -08:00
Wez Furlong
598c2d8c26 notifications: set the resident hint
Even with setting this, I'm 0 for 4 different systems in having the
notifications actually stay on the screen until dismissed.

This was successful at displaying a notification on the pixelbook
desktop though, so that's 1/3 linux systems that have had success.
2019-12-04 19:55:43 -08:00
Wez Furlong
c547b03b8b add basic notifications if the config is broken during reload 2019-12-04 18:26:47 -08:00
Wez Furlong
4ef20480c5 wayland: implement clipboard
This was honestly a PITA because of its complexity.  The `clipboard`
crate (now dropped as a dep) didn't support wayland, so I looked at
the `smithay-clipboard` crate, which caused all of my input to become
laggy just by enabling it--even without actually copying or pasting!

Both of those crates try to hide a number of details of working with
the clipboard from the embedding application, but that works against
our window crate implementation, so I decided to integrate it into
the window crate using Futures so that the underlying IPC timing and
potential for the peer to flake out are not completely hidden.

This first commit removes the SystemClipboard type from wezterm
and instead bridges the window crate clipboard to the term crate
Clipboard concept.

The clipboard must be associated with a window in order to function
at all on Wayland, to we place the get/set operations in WindowOps.

This commit effectively breaks the keyboard on the other window
environments; will fix those up in follow on commits.
2019-11-29 12:17:52 -08:00
Wez Furlong
c63766ffe2 window: wayland: input mostly working, and hidpi output
Some key mappings are not done yet (arrows!) and need to make
opengl work, but this can run a basic wezterm with the software
renderer under wayland.
2019-11-27 22:00:44 -08:00
Wez Furlong
1ba720b28c automatically reload config when the file changes 2019-11-24 19:20:14 -08:00
Wez Furlong
3057befa5d remove use of tinyfiledialogs
It will pass the message text to the shell without proper quoting
which results in it running all sorts of garbage depending on
the message you're trying to display.

Very scary!

refs: https://github.com/jdm/tinyfiledialogs-rs/issues/19
2019-11-22 08:48:33 -08:00
Wez Furlong
ac028da1b6 fix an issue with rate limiting data from the child pty
We need to chunk the data that we read from the child otherwise
we may potentially try to admit more data in a single action
than the ratelimiter will ever allow (eg: if we read 4k of data
and the limit is 100 bytes per second, we can never send that
4k of data in a single write).

Our handling of that situation was not good: we'd panic and kill
the background thread that was reading the data, but the rest
of the app was still running.

This commit upgrades to the most recent rate limiter crate
and performs explicit chunking of the output so that we
behave more sanely.

Refs: https://github.com/wez/wezterm/issues/65
2019-11-21 08:36:16 -08:00
Wez Furlong
d716578735 Add optional basic tab UI at the top of the window
This is a little ghetto feeling because we're just stealing the top
line from the terminal model, rather than rendering anything
particularly native, but it is relatively quick and easy to do,
and helps improve the feel when using wezterm on a chromebook
inside crostini; in that environment, the system doesn't render
any text in the window titlebars (WTF!?) so it is desirable
to show something to help navigate the UI.

The tab bar is off by default for now; we'll definitely want to
add options to configure at least the colors, and perhaps add
a keybinding to toggle it at runtime.

```
enable_tab_bar = true
```

While adding support for the tab bar, I found a couple of little
bugs relating to computing the number of rows and columns; one
was during resize where we'd use the prior size instead of
the current size.  Another was during tab spawning where we'd use
a slightly different calculation to determine the size and end
up raising an error about being confused about the screen size.
2019-11-20 21:57:41 -08:00
Wez Furlong
58d4a0a020 remove local workaround for core-foundation UB issue
My fixes landed upstream in 0a3ac83c1b
and are released already to crates.io
2019-11-13 00:05:55 -08:00
Wez Furlong
6c2fbd43db update ssh2 dep 2019-11-08 18:49:31 -08:00
Wez Furlong
b644b5ac6c windows: bump embed-resource version 2019-11-04 08:01:14 -08:00
Wez Furlong
d5b02edad2 update core-text dep 2019-10-27 23:31:44 -07:00
Wez Furlong
4cb74e68dd remove winit/glutin based frontend 2019-10-27 23:31:44 -07:00
Wez Furlong
d97a84f984 render iterm2 image protocol in the software renderer
This is still a bit rough because the terminal parser doesn't
understand the pixel sizes, so it relies on the hard coded
cell dimensions being accurate.
2019-10-26 23:30:39 -07:00
Wez Furlong
aff6016493 remove force-fontconfig feature 2019-10-26 14:43:30 -07:00
Wez Furlong
55dd7acad3 remove x11 frontend
It has been superseded by the newer opengl->software frontend
2019-10-26 14:42:27 -07:00
Wez Furlong
9f3445a82c make mio dep enable-winit specific 2019-10-26 10:36:40 -07:00
Wez Furlong
dba125c0ff remove unused foreign-types dep 2019-10-26 10:30:48 -07:00
Wez Furlong
95d3fb7aeb start making it possible not to build winit+glutin 2019-10-26 09:51:29 -07:00
Wez Furlong
ba56a86201 remove direct gl dependency 2019-10-26 09:33:31 -07:00
Wez Furlong
d81465a39b remove the force-glutin feature 2019-10-24 23:37:05 -07:00
Wez Furlong
2a19850350 add opengl frontend that sits on top of the window code
This uses the same plumbing as the software frontend, but tries
to enable opengl.

None of the opengl rendering is plumbed through here yet, so this
is currently functionally identical to the software renderer.
2019-10-07 07:51:49 -07:00
Wez Furlong
c6fd88d8c5 add basic simd support for clearing rectangles 2019-09-29 20:24:26 -07:00
Wez Furlong
c7c25025ed upgrade euclid dep 2019-09-21 12:32:21 -07:00
Wez Furlong
276041a1db add very basic win32 window creation 2019-09-15 19:09:08 -07:00
Wez Furlong
16a17857f6 update to ssh2 0.4.0 2019-09-15 17:54:37 -07:00
Wez Furlong
e818ad9dd1 pty, wezterm: add support for serial ports
Tested only on windows with a USB serial connector to my NUC running
linux.

This allows opening up wezterm on a serial port connection.
Serial is closer to a tty than a pty, so it is a bit different
to configure and use.

This commit allows running:

```
wezterm serial COM3
```

to open a window that connects to the specified COM port.

You can change the baud rate with:

```
wezterm serial --baud 9600 COM3
```

There are more options that could be set, but I'm a bit lazy and
have only exposed the baud rate to the wezterm cli so far.
2019-08-07 10:59:42 -07:00
Wez Furlong
ca8227a00f use my fork of ssh2 so that we can run properly on windows 2019-08-05 13:40:43 -07:00
Wez Furlong
c294b4d7a1 allow direct ssh pty
This basically works, but I want to tidy up how we enable this kind
of connection; right now its a bit of a hack.
2019-08-03 12:47:55 -07:00
Wez Furlong
5d6f1a5725 adjustments for upstream ssh2 crate changes 2019-08-01 10:26:39 -07:00
Wez Furlong
a7722beb0a add support for unix mux via ssh
This adds an ssh domain config type that allows us to ssh to a remote
host and then proxy the unix domain mux protocol over the ssh session.
2019-07-28 16:15:44 -07:00
Wez Furlong
919c4d96e8 update filedescriptor crate
Pick up this fix to avoid hanging when closing out a mux'd tab:
bd4df51948
2019-07-16 00:30:53 -07:00
Wez Furlong
51ead397f6 avoid use of a fork of structopt just for vergen compat
This is much simpler!
Clean up some of the attributes while I'm in here.

refs: https://github.com/TeXitoi/structopt/issues/209
2019-06-27 07:21:59 -07:00
Wez Furlong
086e9e9b64 pin structopt more precisely so that the vergen patch stays working
Upstream bumped versions and this is causing warnings in CI
2019-06-26 21:07:39 -07:00
Wez Furlong
472b2d38f7 try harder to get openssl vendoring right 2019-06-22 14:28:52 -07:00
Wez Furlong
3ba62a8a1c vendor in openssl on macos 2019-06-22 14:15:44 -07:00
Wez Furlong
4c877d493f add --daemonize flag 2019-06-22 12:44:22 -07:00
Wez Furlong
9a4ae0a06b ratelimit child process output
In the early days we relied upon the bounded length of a sync channel
to put back pressure on the output from a child command.  We're no
longer using that kind of channel, so here's a more deliberate and
measurable rate limiting implementation.

The `ratelimit_output_bytes_per_second` configuration setting defaults
to 2MB/s and constrains the amount of text we send to the escape
sequence parser.

This value was selected based on it being a combination of responsive
to ctrl-c while outputing a lot of data and still generating sleeps
to remain within the constraints.

This does mean that terminal benchmarks that test how quickly you
can dump text to the terminal will hit this artifical upper limit
and are thus not going to be a true measure of performance.
2019-06-21 07:16:37 -07:00
Wez Furlong
16e26797d4 make openssl the default on unix systems 2019-06-20 17:35:20 -07:00
Wez Furlong
0b9c953446 bump for filedescriptor changes 2019-06-20 06:55:10 -07:00
Wez Furlong
97daa8b246 switch to using the poll stuff from filedescriptor 0.3 2019-06-19 00:01:35 -07:00
Wez Furlong
6ceefb2576 re-structure client in readiness for unilateral responses 2019-06-16 21:04:53 -07:00
Wez Furlong
8f81da406e make openssl optional
Concerned about packaging that bit on windows at the moment
2019-06-14 06:40:02 -07:00
Wez Furlong
f86b65270b add basic tls listener
We don't yet have a client that knows how to connect to it
2019-06-14 06:40:02 -07:00
Wez Furlong
1d44098747 add cli command to list tabs 2019-06-13 21:53:14 -07:00
Wez Furlong
01a8c32b55 unblock tunneled mux protocol work
It's taking a while for https://github.com/jwilm/vte/pull/20 to get
merged, so point to my branch directly while I build out some
tunneled mux protocol escape sequences.

I'll need to fork vte on crates.io if vte doesn't merge the PR
before the next termwiz crate bump.
2019-06-13 06:57:10 -07:00
Wez Furlong
c1e605aedf register client tab with mux, add reader that never reads 2019-06-09 15:58:06 -07:00
Wez Furlong
7197ee6277 add Downcast trait to FrontEnd
This removes some awkwardness in the impl by allowing casting
to a concrete implementation.  This is a pattern I want to use
more widely and this diff proves the concept.
2019-06-09 11:13:05 -07:00
Wez Furlong
5bf2268292 more log changes 2019-06-08 15:30:47 -07:00
Wez Furlong
34d6d95b6f adopt log and env_logger for logging 2019-06-08 15:17:41 -07:00
Wez Furlong
3a3755fbe6 moved varbincode to its own repo 2019-05-27 19:44:55 -07:00
Wez Furlong
e1a1530d22 remove boxfnonce: now require rust 1.35+
Rust can now naturally deal with with these constructs, so drop the
external crate.
2019-05-26 09:14:20 -07:00
Wez Furlong
7bf1d99d77 move pty to its own crate in preparation for publishing
Refs: https://github.com/wez/wezterm/issues/27
2019-05-19 18:40:26 -07:00
Wez Furlong
67ec001c11 update glium dep; can drop our patch for it now 2019-05-05 06:55:19 -07:00
Wez Furlong
52be4c9ba7 remove use-winpty feature flag 2019-03-25 19:46:59 -07:00
Wez Furlong
eeab341879 add use-winpty feature
When enabled, the windows version will use winpty rather than conpty.
This potentially allows running on older windows versions but has
a few caveats:

* Requires winpty.dll and winpty-agent.exe be in the PATH
* The initial screen / cursor position looks funky for me with the
  latest release of winpty, but that is from a couple of years ago
* Mouse reporting doesn't work, perhaps for the same reasons that
  it isn't working in conpty.

I want to make this into a runtime selectable feature before tidying
up the installation aspects; we need that plumbing anyway to be
able to select between local and remote mux'd tabs.
2019-03-25 09:21:00 -07: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
d80f58f7bc use vergen to embed the git version info in the output 2019-03-23 23:45:14 -07:00
Wez Furlong
967d43d57c dynamically load conpty functions on windows
This allows travis to build and run tests, even though it can't run
the full gui.
2019-03-23 17:07:10 -07:00
Wez Furlong
db015e9ff1 tidy up the cargo manifest 2019-03-23 13:57:26 -07:00
Wez Furlong
10b3460c49 remove rusttype 2019-03-23 13:45:26 -07:00
Wez Furlong
ed2e407df1 enable harfbuzz on windows 2019-03-23 11:53:45 -07:00
Wez Furlong
27cb18f8ae Build our own freetype, harfbuzz
This is primarily for macos where the default freetype
installation is unable to render color emoji, but should also
help make things more consistent across the various platforms.

It's a little bit awkward on linux because the font-loader crate
pulls in the now-conflicting servo-font* crates.  I've disabled
font-loader on linux systems; it's just calling fontconfig under
the covers anyway.
2019-03-23 09:28:40 -07:00
Wez Furlong
a4a078cf98 Employ zstd compression for large pdus
This cuts down the coarse data from ~13k to ~200 bytes
2019-03-22 20:41:50 -07:00
Wez Furlong
2077e3fd21 use varbincode for mux protocol; results in ~3x smaller packets
Reduces the size of the full screen serialized size from 40k -> 13k.

Note that the `zlo` crate (which doesn't appear to have a repo
on github any longer; sources are only found in the crates.io
documentation source view), employes zigzag encoding of all integers
and floating point values and takes the size down to just under 10k.

A todo is to follow up on that and see if we could adopt the same
scheme in varbincode.
2019-03-22 20:41:50 -07:00
Wez Furlong
322f7c74e6 add varbincode 2019-03-22 20:41:50 -07:00
Wez Furlong
7cdd1876d1 Enable serializing various Line and Cell related structs 2019-03-22 20:41:50 -07:00
Wez Furlong
6575f50ffc the directories crate spawns a lot of children! stop using it
The `directories` crate unconditionally and eagerly tries to spawn
`xdg-user-dir` for all possible directories that it might be asked
about.  This is relatively expensive and undesirable.

Shift to the `dirs` crate instead, which doesn't seem to need
to run `xdg-user-dir` at all.

Maintain these probed dirs as singletons via lazy_static.
2019-03-22 20:41:50 -07:00
Wez Furlong
891bd89939 add codec skeleton and tests 2019-03-22 20:41:50 -07:00
Wez Furlong
9d9fd6eb6b pin harfbuzz to my version so that macos continues to build 2019-03-22 12:24:52 -07:00
Wez Furlong
a0a0bc0902 Add base91 crate
The plan is to use this to tunnel the mux protocol over a pty.
2019-03-07 09:03:19 +00:00
Wez Furlong
4b4be6ac21 remove futurecore 2019-03-04 22:32:59 +00:00
Wez Furlong
1d37e44b62 move promise to its own crate 2019-03-04 15:38:56 +00:00
Wez Furlong
e8a4f8f94c add executor for promise/future library 2019-03-04 10:48:15 +00:00
Wez Furlong
7ef388e607 add promise library 2019-03-03 15:22:22 -08:00
Wez Furlong
d71ac26b93 add very bare bones skeleton for unix domain socket bits 2019-03-03 05:08:58 -08:00
Wez Furlong
20dcced8f7 fixup windows build 2019-03-02 13:16:25 -08:00
Wez Furlong
5b126b3f1e Restore fullscreen toggle hotkey and fixup for macos 2019-02-23 13:27:59 -08:00
Stephane Fontaine
b94527664f Initial xkbcommon support
Remove detailed xcb select event hack

Only remove consumed "mod5" for now

which is AltGr.

Get actual modifiers from xkb.

it should enable 1:1 match with user's xmodmad

[clippy] allow keys deadcodes

handle mods & keys separately. Allows passing down `ctrl+2`

state.key_get_utf8 will interpret ctrl+2 (or @, space, ~) to 'ctrl \u{0}'

no need to wait for events.

+ Send delete as enum variant not by char value

Hook XKeysym to termwiz::KeyCode

prefer dealing with chars instead of utf8

Actually this breaks multi unicode characters .. such as J́
Others can be found with
perl -lane '/"\s+#/ && print' < /usr/share/X11/locale/en_US.UTF-8/Compose

Anyway we will need to return a Vec of chars for those.

cleanup

apply rustfmt

query locale via libc
2019-02-23 13:04:39 -08:00
Wez Furlong
983eca1209 enable debug symbols in release builds 2019-02-22 20:59:03 -08:00
Wez Furlong
d35dd3721b fixup macos build on !wez's laptop
Refs: https://github.com/servo/rust-harfbuzz/pull/128
2019-02-22 17:59:48 -08:00
Wez Furlong
97096ffc5d implement coretext font rendering
This uses harfbuzz for shaping and thus can render both emoji and
ligatures

Refs: https://github.com/wez/wezterm/issues/5
2019-02-22 15:21:04 -08:00
Wez Furlong
b0c2704118 clap -> structopt
This looks like it will help with some enum parsing
2019-02-20 07:54:31 -08:00