1
1
mirror of https://github.com/wez/wezterm.git synced 2024-12-19 19:31:49 +03:00
Commit Graph

1730 Commits

Author SHA1 Message Date
Wez Furlong
8996f897b9 remove Mux::config in favor of config::configuration()
The idea is to centralize accessing the config to that
function so that we can implement config reloading.
2019-11-24 09:07:46 -08:00
Wez Furlong
72b55d3982 config: lay foundation for config reloading 2019-11-24 08:28:30 -08:00
Wez Furlong
07c6ca94da move some code around in config/mod.rs 2019-11-24 07:56:38 -08:00
Wez Furlong
eed6049902 tidy up config imports a little 2019-11-24 07:55:13 -08:00
Wez Furlong
0f64357203 change default font size to 10pts
I realized that I had set this to 10pts in my configs, and after running
with the default for a bit today, I agree with @chadaustin that we
should be smaller by default!
2019-11-24 07:51:10 -08:00
Wez Furlong
1d5e36a97c split more config into separate modules 2019-11-24 07:50:13 -08:00
Wez Furlong
955361433d split daemon options out of config/mod.rs 2019-11-24 07:37:42 -08:00
Wez Furlong
2960b9186c config.rs -> config/mod.rs + config/keys.rs 2019-11-24 07:35:12 -08:00
Wez Furlong
517084ff2f clippy 2019-11-24 07:20:41 -08:00
Wez Furlong
385b3bedbd move some config defaults into the config module 2019-11-24 06:56:41 -08:00
Wez Furlong
e904e11e58 tab bar: default to enabled 2019-11-23 16:58:37 -08:00
Wez Furlong
10a0006eaf window: fix build for examples post mouse coords changes 2019-11-23 16:46:46 -08:00
Wez Furlong
bbe9c6e14b window: Windows: allow dragging by the tab bar 2019-11-23 16:43:25 -08:00
Wez Furlong
ef0f53ab7b window: Windows: fix mouse screen coordinates 2019-11-23 16:00:27 -08:00
Wez Furlong
d778d8b130 disable csi-u sequences by default
I keep holding shift while pressing space and seeing stuff get
undone in vim.  Super annoying.  I didn't see a good way to
teach applications about this via terminfo, so this is off
by default for now.

refs: https://github.com/wez/wezterm/issues/63
2019-11-23 15:04:54 -08:00
Wez Furlong
f3f61b47dc tab bar: add new tab button to tab bar 2019-11-23 14:57:17 -08:00
Wez Furlong
a28e4c0e1e allow dragging by the tab bar on macOS 2019-11-23 14:05:39 -08:00
Wez Furlong
349a24ccd9 allow dragging by tab bar on linux
This works with X11 on fedora, but the window movement is ignored
by the xwayland machinery on chromeos.
2019-11-23 11:46:03 -08:00
Wez Furlong
01eaa7db08 window: adopt Point for mouse coordinates
and allow them to be signed again
2019-11-23 08:48:09 -08:00
Wez Furlong
14fbf43485 promise: more properly implement Future::poll
The future won't ever complete if you don't connect the waker
from the context!

Prove this out by making the windowops functions async and
verifying them in the async example
2019-11-23 08:16:12 -08:00
Wez Furlong
152874dd23 window: fixup the async example for stable async 2019-11-23 08:16:12 -08:00
Wez Furlong
9d8e664ec0 tidy up the error output in the case that we fail with an error 2019-11-22 20:32:03 -08:00
Wez Furlong
4e1cfe01a8 linux: fix potentially busy loop
I introduced this issue with the recent rate limiting changes.  If we
generated sufficient events to fill the pipe buffer and trigger an
EAGAIN on the write side of the pipe, we'd end up in a state where epoll
would continually wake us up to deal with it, but because we gated
reading from the pipe on having entries in the queue we could decide
that there was nothing to do and leave the pipe unread.

This commit adjusts things so that we always try to read some data from
it.

This is OK because we're using the pipe to knock the main thread out of
a sleep rather than as the definitive count of events.
2019-11-22 14:06:17 -08:00
Wez Furlong
185e72b1fe simplify error logging in main 2019-11-22 10:55:48 -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
95900dc0a5 add some debug to SpawnQueue::has_any_queued
I'm seeing occasional 100% cpu usage on my linux system and I'm
not sure if its just because I'm running a stale binary.
I added this (commented out in this commit, but live on my local
system) debug print to help understand it.
2019-11-22 07:08:22 -08:00
Wez Furlong
5dfd03468b config: DRY; use serde defaults for Config 2019-11-22 06:50:39 -08:00
Wez Furlong
1737ca4d80 fix subtraction overflow when creating a new window when tab bar enabled 2019-11-22 04:51:55 +00:00
Wez Furlong
e9ec35713c raise ratelimit_output_bytes_per_second
10k was a bit tight for a full-screen vim window, so bump
it up a bit more.
2019-11-21 19:03:46 -08:00
Wez Furlong
3d7dbe9e76 fixup windows packaging CI
make this match the non-packaging CI config and ensure that it updates
the version of rust that is installed.
2019-11-21 18:58:59 -08:00
Wez Furlong
a5ece82d69 fix compilation on macos
refs: https://github.com/wez/wezterm/issues/65
2019-11-21 18:31:02 -08:00
Wez Furlong
6787512d62 avoid busy looping over the spawn queue
Refs: https://github.com/wez/wezterm/issues/65
2019-11-21 18:20:59 -08:00
Wez Furlong
824ec691fe revise ratelimit_output_bytes_per_second default
I've found that 10_000/s strikes a reasonable balance between
output speed and the ability to interrupt the output.

Refs: https://github.com/wez/wezterm/issues/65
2019-11-21 18:20:30 -08:00
Wez Furlong
06da330087 add low pri spawn queue
Refs: https://github.com/wez/wezterm/issues/65
2019-11-21 18:20:17 -08:00
Wez Furlong
b3032f8a5a window: macos: yes starvation fix
Similar to b83a63126c, this helps
to avoid starving the gui events.

Refs: Refs: https://github.com/wez/wezterm/issues/65
2019-11-21 17:34:01 -08:00
Wez Furlong
6461dc15f0 ci: nightly rust isn't installable and is broken
I can't install it locally either, so let's just turn it
off in the CI
2019-11-22 01:20:02 +00:00
Wez Furlong
b83a63126c fix a starvation issue on linux/x11 systems
The `SpawnQueue::run_impl` would loop until it had exhausted
all queued items.  This prevents returning to the main loop
and resulted in the UI hanging while eg: `yes` was running,
and could also block accepting keyboard input, which is
pretty bad.

In addition, the queue implementation could fill up a pipe
and block the write side while it held a lock, which in
turn would prevent the read side from making room for the
write to succeed!

This commit changes the behavior on linux to change the wakeup
behavior of the queue from having a 1:1 relationship between
enqueue:wakeup to n:m where n and m are both >= 1.  This is
sufficient to wake a sleeping gui thread.  The gui thread
can then pop and process a single item at a time, interleaved
with dispatching the gui events.

The result is a bit more responsive, however, there is no
backpressure from the gui to the read side, so if the read
side is eating 2MB/s of data and the GUI side is processing
less than this, then an interrupt signal may still take a
few seconds to take effect.

I have mixed feelings about adding backpressure, because
I'm not sure that it is worth actually rendering all of
the parsed output text when there is a lot of it.

I need to follow up and verify these changes on macOS
and Windows too.

Refs: https://github.com/wez/wezterm/issues/65
2019-11-21 16:53:01 -08:00
Wez Furlong
a031b5b9eb improve the rate limiter
when over the budget, this reduces to a trickle of 1 byte per
appropriate sub-second interval.  For example, if the limit is
set to 100 bytes per second, we admit 1 byte every 10ms.

Refs: https://github.com/wez/wezterm/issues/65
Refs: https://github.com/wez/wezterm/pull/67
2019-11-21 14:42:33 -08:00
Wez Furlong
a26a94b5bb config: allow specifying NONE or "" for key modifiers
previously, we would raise an error for these, which made it
awkward to eg: bind just F1 to an action.
2019-11-21 10:25:14 -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
371e07838d tab bar: set mouse to arrow when in tab bar 2019-11-21 07:08:31 -08:00
Wez Furlong
c6b62d8055 tab bar: default mouse coords outside of view
This helps to prevent a spurious hover styled tab caption being rendered
in some cases.
2019-11-21 00:11:51 -08:00
Wez Furlong
ac7a509dbb allow configuring the tab bar
The defaults are pretty neutral.  You can get a little more fancy
with something like this:

```
[colors.tab_bar]
background = "#0b0022"

[colors.tab_bar.active_tab]
bg_color = "#2b2042"
fg_color = "#c0c0c0"

[colors.tab_bar.inactive_tab]
bg_color = "#1b1032"
fg_color = "#808080"

[colors.tab_bar.inactive_tab_hover]
bg_color = "#3b3052"
fg_color = "#909090"
italic = true
```
2019-11-21 00:04:49 -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
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
d397976acf fix rendering of the cursor position in the line editor 2019-11-16 13:58:01 -08:00
Wez Furlong
6289c08a4e Adopt CSI u modifier encoding for keypresses
See http://www.leonerd.org.uk/hacks/fixterms/ for the specification.

Refs: https://github.com/wez/wezterm/issues/63
2019-11-16 13:38:03 -08:00
Wez Furlong
9e3c6a4ef9 term: simplify key -> escape sequence mapping
refs: https://github.com/wez/wezterm/issues/63
2019-11-16 09:04:55 -08:00
Wez Furlong
b79ccb50c4 Add option to swap Backspace and Delete
This defaults to true on macOS

Fixes https://github.com/wez/wezterm/issues/64
2019-11-15 19:52:44 -08:00
Wez Furlong
fccb855837 Document the windows hotkeys
Closes https://github.com/wez/wezterm/issues/34
2019-11-14 22:11:58 -08:00