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

871 Commits

Author SHA1 Message Date
Wez Furlong
d543d07c69 software: remove drop handler 2019-09-28 20:46:31 -07:00
Wez Furlong
ed25cc81e6 fix an issue where closing tab 0 wouldn't repaint the new tab 0 2019-09-28 19:54:37 -07:00
Wez Furlong
7e09492606 Add close operation on macos 2019-09-28 17:46:43 -07:00
Wez Furlong
34f60dfa7f software: add font size key assignment handling
This doesn't know how to resize the window at the moment, which is
different from how the opengl renderer behaves.
2019-09-28 16:00:08 -07:00
Wez Furlong
a3a54837b7 software: implement paste key assignment 2019-09-28 15:50:42 -07:00
Wez Furlong
436bdf7589 software: implement most key assignments 2019-09-28 13:46:17 -07:00
Wez Furlong
a7c4eb430d export key map code from guicommon 2019-09-28 12:54:11 -07:00
Wez Furlong
6dac1a5cf0 software: always render emoji using its own color
This avoids just rendering black when dragging the selection over
the glyph
2019-09-28 10:44:29 -07:00
Wez Furlong
40d7186a9c software: pre-scale emoji so they render more reasonably
Since we don't have a draw-image-and-rescale primitive, and since
we'd have to scale every time we drew the glyph, it makes sense to
cache the pre-scaled glyph in the atlas.
2019-09-28 10:20:17 -07:00
Wez Furlong
389c477b16 software: ligatures now render, but scaled emoji need work 2019-09-28 10:06:47 -07:00
Wez Furlong
2a7892e3c5 software: fill marginal areas outside cell dimensions 2019-09-28 09:19:51 -07:00
Wez Furlong
a9621170f7 window: on macos, query the dpi and improve resize/scaling handling 2019-09-28 09:01:14 -07:00
Wez Furlong
8e38f34b6d fix a couple of warnings 2019-09-22 21:02:02 -07:00
Wez Furlong
2afb2810cc plumb mouse events for software frontend 2019-09-22 13:43:30 -07:00
Wez Furlong
ec280a54f8 incomplete but functional key input for software frontend 2019-09-22 10:25:31 -07:00
Wez Furlong
4de30373b6 tidy up window/tab closing and quitting for software frontend 2019-09-22 08:38:35 -07:00
Wez Furlong
88d15e18af factor our underline/strikethrough metrics for software render 2019-09-22 08:26:54 -07:00
Wez Furlong
ccb27b3422 fixup a few warnings 2019-09-22 08:21:36 -07:00
Wez Furlong
68f81e23f7 software render can now render basic glyphs 2019-09-22 08:12:52 -07:00
Wez Furlong
f17824994f window: add basic timer functionality
We need this to poll the model and invalidate the gui so that it
can repaint as the child process emits output
2019-09-21 22:16:27 -07:00
Wez Furlong
a58a0be632 wire up basic cursor and background color for software render frontend 2019-09-21 17:32:19 -07:00
Wez Furlong
86ba590ead fixup some missing dyn 2019-09-21 13:36:15 -07:00
Wez Furlong
a236cf6c08 fixup for euclid + rect/point/draw_line changes 2019-09-21 13:16:23 -07:00
Wez Furlong
c7c25025ed upgrade euclid dep 2019-09-21 12:32:21 -07:00
Wez Furlong
c19b7db705 fill software window background with black 2019-09-15 19:43:32 -07:00
Wez Furlong
1c8ba615f3 fix build on macos 2019-09-15 19:09:08 -07:00
Wez Furlong
2ace5c7bb4 fixup wezterm compilation for window changes 2019-09-15 19:09:08 -07:00
Wez Furlong
6d23be0164 use Image to generate underline glyphs 2019-09-15 19:09:08 -07:00
Wez Furlong
e98b29aec6 add apply function to safely access inner data 2019-09-15 19:09:08 -07:00
Wez Furlong
0b7556893d bunch of plumbing to allow using new window layer as software rendered frontend 2019-09-15 19:09:08 -07:00
Wez Furlong
cab062118b promise: split execute out to BasicExecutor
This makes it easier to implement just the scheduling portion
without imposing other restrictions on the executor type.
2019-09-15 19:09:08 -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
24f6d90ccf improve error reporting for mux-over-ssh 2019-08-06 18:55:55 -07:00
Wez Furlong
786a4c8551 pty: add concept of "default prog" to the pty layer
Previously we had the logic for this in wezterm itself; it would know
how to figure out which shell to run, or whether we should run a
different program by default (the `default_prog` setting).

This was OK, but when I added support for ssh we hit a conceptual
issue: the local side of the ssh session doesn't have any information
about the shell that should be invoked on the remote side and instead
needs to ask the remote to figure that out.   The interfaces defined
in the code didn't allow for this.

This commit formalizes the concept of a default program and allows
it to be carried through to the pty layer, including over ssh sessions.

Since we now have enough smarts to figure out the local shell and the
local home dir, I've removed the logic that run `login -pf` on macos
by default; this should make the terminal startup very slightly faster
on macos, but since I'm currently on a windows system, I can only test
linux and windows on this side of this commit.  I'll follow up on macos
later.
2019-08-06 15:03:25 -07:00
Wez Furlong
863cf1768a pty: fixup passing term to ssh pty requests 2019-08-06 14:17:03 -07:00
Wez Furlong
567f3c4c0b remove muxed prefix from mux client title bar 2019-08-06 08:33:01 -07:00
Wez Furlong
cd31323c6a use dark mode by default on windows 2019-08-05 18:00:41 -07:00
Wez Furlong
df43d0e0e9 groundwork for re-connecting muxer over ssh
We can't enable this until we grow some smarts about when the disconnect
warrants a reconnection or not.
2019-08-05 13:41:23 -07:00
Wez Furlong
093a0bb541 refactor code that iterates over client domains
More DRY
2019-08-05 12:55:58 -07:00
Wez Furlong
0fed030dac add wezterm connect DOMAIN subcommand for connecting to muxer
This makes it a bit more convenient to control when and which
multiplexer(s) you want to connect to.

Now that each domain must have a name in the configuration file,
we can address them more conveniently from the command line.
2019-08-05 11:39:05 -07:00
Wez Furlong
f9137c0eec allow using domain names in keybindings and Mux lookup 2019-08-05 11:20:28 -07:00
Wez Furlong
5d6bc3882c require all domains to have names 2019-08-05 11:04:56 -07:00
Wez Furlong
af69842fa0 fix parameter order :-/ 2019-08-05 10:49:48 -07:00
Wez Furlong
51c336d94f remove SshDomain.direct_pty
Now that we have `wezterm ssh ...` we don't need this to be in the
configuration.
2019-08-05 09:43:02 -07:00
Wez Furlong
b46dbe60ba use $USERNAME on windows when defaulting ssh user 2019-08-05 09:35:30 -07:00
Wez Furlong
127b2a567b add wezterm ssh user@host some command
This is mostly useful for folks on Windows, as you can also run
`wezterm start ssh user@host some command` to run the `ssh` binary in a
local pty and let it manage your ssh session.

On Windows the local pty currently breaks mouse reporting
(see https://github.com/microsoft/terminal/issues/376) so it is
desirable to avoid using a local pty if we're going to talk to a
remote system.

This commit makes it a bit more convenient to establish an ad-hoc ssh
session with a pty on a remote host.  This method uses libssh2 under the
covers and thus doesn't support gssapi, which is potentially frustrating
for kerberized environments, but works ok for the majority of users.

There are two issues that I want to resolve in follow up work:

* The TERM has to be sent very early in the channel establishment,
  before we "know" the TERM in the `portable-pty` interface.  Will need to
  figure out how to specify that earlier in an appropriate way.
* Similarly, if no command is specified, we should request the use
  of the shell subsystem but we don't have a way to capture this
  intend with the cmdbuilder. Will need to solve this too.
2019-08-05 09:05:54 -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
1818cce7f0 factor out ssh connection code 2019-08-03 11:35:44 -07:00
Wez Furlong
3571cd926e cargo fmt fixup 2019-08-02 12:54:18 -07:00
Wez Furlong
5d6f1a5725 adjustments for upstream ssh2 crate changes 2019-08-01 10:26:39 -07:00
Wez Furlong
9d0209d9a5 windows: fix .ssh/known_hosts path 2019-07-30 10:52:10 -07:00
Wez Furlong
dde589af49 fix an issue with pid files when running under wsl
They don't always work, so let's just not use them when under wsl.
Since we now know how to detect when we're running under wsl, we
can use that knowledge to bypass permission checking for the unix
domain sockets automatically too.
2019-07-30 09:45:00 -07:00
Wez Furlong
348575854d Capture terminal errors and show them in a message box
This helps diagnose problems where stderr is not visible.
Let's also capture them to the `log` stream too, and clarify
toml parsing errors, and fix the underlying problem with
ssh_domains not being allowed to be left unspecified.
2019-07-30 08:45: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
83e1f410e0 remove dead code attribute 2019-07-23 11:11:19 -07:00
Wez Furlong
3d8e4f8b0e fix issue where focusing the window would clear the clipboard
This was particularly noticable on windows.
2019-07-17 08:58:45 -07:00
Wez Furlong
7e50c4db68 workaround conpty drop issue 2019-07-17 08:42:41 -07:00
Wez Furlong
25bb43262d unbreak the default windows pty
I was too focused on the wsl case and didn't test this.  We can't
redirect the process handles without causing some problems with
starting up cmd.exe.   Comment out that portion of the code for
the moment.
2019-07-16 23:04:38 -07:00
Wez Furlong
e2ac4ebb49 remove some stray debug prints 2019-07-16 20:57:43 -07:00
Wez Furlong
48a12da096 capture logs on startup on win32, fixup spawning wsl from gui 2019-07-16 14:14:40 -07:00
Wez Furlong
34ae350d88 allow spawning a server inside wsl 2019-07-16 09:05:35 -07:00
Wez Furlong
8cc5f33600 fix unix domain mux on windows
WSAPoll really doesn't like it if you pass in POLLERR, so don't do that.
2019-07-16 00:29:34 -07:00
Wez Furlong
9370a2d07b improve error logging when failing to daemonize 2019-07-09 09:12:15 -07:00
Wez Furlong
df20277d85 clippy 2019-07-06 08:18:59 -07:00
Wez Furlong
d67d4aab57 avoid marking a tab as dead when we might reconnect it 2019-06-29 16:31:13 -07:00
Wez Furlong
4fc6914602 reduce the amount of RefCell is in server/tab.rs 2019-06-29 16:31:13 -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
285136169e reconnect tls connections automatically 2019-06-26 15:04:53 -07:00
Wez Furlong
96c61fcd53 refactor client to prepare for reconnecting 2019-06-26 15:04:53 -07:00
Wez Furlong
abfd98b7c6 advise the mux when a domain has detached; remove its tabs 2019-06-26 15:04:53 -07:00
Wez Furlong
5c6f44d47f ClientDomain: treat as detached if connection is closed
We detect this when the client thread falls out of its processing
loop.
2019-06-26 15:04:53 -07:00
Wez Furlong
c9489d391b Allow deferred attach of domains
This adds some plumbing so that a domain can indicate whether it is
attached or not, but is not yet smart enough to detect a closed
connection and mark itself as detached.
2019-06-26 15:04:53 -07:00
Wez Furlong
bb04d91101 remove sync_channel, re-fixes large pastes under glium
The sync_channel was originally added as a brake to avoid swamping
the event loop, but we've subsequently grown a more formal rate
limiting config for this.

The rate limiter is superior because it allows making forward
progress over time, whereas the bounded channel is a hard blocking
limit.

When making a large paste the app on the other end will typically
emit a lot of output.  If our reader is blocked on the sync channel
the output of the pty can be blocked, and that in turn will block
our attempt to write to the pty.

We cannot simply set the pty to non-blocking mode because non-blocking
ptys are not a thing on windows, and in the interest of not silently
breaking windows, I prefer to make the unix side of things match
that architecture.

anyway: TL;DR is that we don't need the bounded channel now that
we have rate control to manage swamping the event loop, so we
can simplify this code.
2019-06-24 07:28:40 -07:00
Wez Furlong
4c6768fd2b fixup windows build 2019-06-22 13:40:41 -07:00
Wez Furlong
be345853cd allow spawning the server automatically when connecting via unix domain 2019-06-22 13:22:28 -07:00
Wez Furlong
7751a85826 fix subtraction underflow 2019-06-22 13:14:08 -07:00
Wez Furlong
4c877d493f add --daemonize flag 2019-06-22 12:44:22 -07:00
Wez Furlong
33f17eaf3f remove WEZTERM_SKIP_MUX_SOCK_PERMISSIONS_CHECK env var in favor of config value 2019-06-22 11:01:17 -07:00
Wez Furlong
2e63989c6e add option to avoid connecting to multiplexers on startup 2019-06-22 10:24:45 -07:00
Wez Furlong
83a72d505a clippy 2019-06-22 10:18:23 -07:00
Wez Furlong
6c8d296c44 respect the connect_automatically configuration
For unix and tls clients, if connect_automatically is set
and we're not running the server, then instantiate and connect
to those domains when we start the app.

As part of this I realized that we weren't mapping the remote
tab to the local tab for unilateral pushes, so add some stuff
to support that.
2019-06-22 10:13:02 -07:00
Wez Furlong
9054343e51 factor out tls client configuration
We can now also specify multiple tls clients
2019-06-22 09:08:31 -07:00
Wez Furlong
86251f1787 factor out tls server configuration
Can now specify multiple servers if desired.
2019-06-22 08:44:14 -07:00
Wez Furlong
712089a5de refactor unix domain configuration
It is now possible to specify multiple domains with varying
configuration.
2019-06-22 08:21:25 -07:00
Wez Furlong
fcc2b1ab7d rejigger tab spawning hotkeys
cmd-t now spawns in the same domain as the active tab,
cmd-shift-t spawns in the default domain.

It is possible to define bindings to spawn in an arbitrary domain.
2019-06-22 07:46:49 -07:00
Wez Furlong
2e84714c97 clippy 2019-06-22 07:06:41 -07:00
Wez Furlong
cb4fa1ac21 get_dirty_lines now uses Cow<Line>
This avoids some extra allocations in the local tab case.
2019-06-22 06:57:35 -07:00
Wez Furlong
dc3c5cbdd6 enable url highlighting over mux 2019-06-21 21:40:48 -07:00
Wez Furlong
e12f413224 propagate url clicks back to client 2019-06-21 18:44:07 -07:00
Wez Furlong
1ee4c14474 add size to cli tab list output 2019-06-21 15:04:31 -07:00
Wez Furlong
9978c1234c restructure throttling around scanning and pushing changes 2019-06-21 08:44:10 -07:00
Wez Furlong
cfeb7e4705 remove dead commented out code 2019-06-21 07:58:49 -07:00
Wez Furlong
4ddef39b52 ratelimit unilateral pushes 2019-06-21 07:56:09 -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
130a7263d4 avoid repeated emission of cursor updates when scrolled back 2019-06-20 21:39:47 -07:00
Wez Furlong
938eb5e1cf remove old coarse pdus 2019-06-20 21:38:08 -07:00
Wez Furlong
760f9f25de implement peer authentication on the server side
This is admittedly pretty environment-specific, but it matches
an environment that I use :-p
2019-06-20 18:46:31 -07:00
Wez Furlong
16e26797d4 make openssl the default on unix systems 2019-06-20 17:35:20 -07:00
Wez Furlong
4ad7ff3083 use openssl directly for the client when that feature is enabled
This removes some redundancy and overhead around setting up the
connection (the native_tls crate doesn't provide PEM functions,
despite every deployment I've ever seen only ever using PEM certs),
but more importantly, gives the control needed to make hostname
verification work in a PKI setup with unusual CN values.
2019-06-20 17:27:40 -07:00
Wez Furlong
6c9e851ffa make mux server frontend channel unbounded
This avoids the possibility of deadlock if you connect to a remote
host and quickly dump a lot of output to the terminal.
2019-06-20 08:59:26 -07:00
Wez Furlong
4171ad3aa3 fix surface size for newly spawned tabs
Problem scenario was:

* spawn a window
* resize it larger
* spawn a new tab

When working with a mux client tab, the surface size in the new tab
didn't reflect the size of the remote surface, so the rendering was
messed up.

Arrange to know the size up front.
2019-06-20 08:46:58 -07:00
Wez Furlong
7bff509540 allow server to unilaterally send clipboard when it changes 2019-06-20 08:29:09 -07:00
Wez Furlong
e993e5a625 allow capturing the clipboard impl from the terminal host
This should allow asynchronous access to the clipboard, which
in turn will allow the server to send the clipboard to the client
unilaterally.
2019-06-20 07:55:03 -07:00
Wez Furlong
0b9c953446 bump for filedescriptor changes 2019-06-20 06:55:10 -07:00
Wez Furlong
40ff31f984 fixup mux session over tls 2019-06-19 09:30:49 -07:00
Wez Furlong
da02bf0ba7 repaint when switching between mux'd tabs 2019-06-19 08:53:05 -07:00
Wez Furlong
26cdb6c87f improve latency for server -> client push 2019-06-19 08:40:19 -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
c18dd96472 can now push changes from server->client
Need to emit them in more places.  The idea is that this helps
to reduce the event->display latency.
2019-06-17 08:47:24 -07:00
Wez Furlong
2f5b710b3e more listener plumbing in readiness for sending unilateral responses 2019-06-17 07:02:21 -07:00
Wez Furlong
5407a31dbb move pollable bits to own module 2019-06-16 22:38:04 -07:00
Wez Furlong
df381e483c refactor server side client session state 2019-06-16 22:29:30 -07:00
Wez Furlong
6ceefb2576 re-structure client in readiness for unilateral responses 2019-06-16 21:04:53 -07:00
Wez Furlong
cf2b4896c5 clippy 2019-06-16 21:04:53 -07:00
Wez Furlong
6beee56675 helpers for streaming decode of pdus 2019-06-16 21:04:53 -07:00
Wez Furlong
1d2b4291d3 prep for dealing with unilaterally sent pdus 2019-06-16 21:04:53 -07:00
Wez Furlong
764597851c allow collapsing mouse events in the mux protocol
Repeated moves or wheel events are collapsed so that we don't clog up
the queue.  The queue size doesn't matter as much as the latency of
processing a large queue.  For fast or repeated moves the queue can grow
rather quickly, and with what is currently ~25-50 ms round trip per
entry for a remote session, that is a poor UX.
2019-06-16 21:04:53 -07:00
Wez Furlong
302db2c976 a lighter way to pass selection ranges for client tabs 2019-06-16 21:04:53 -07:00
Wez Furlong
b58d329b07 some plumbing to use Surface+Change for the mux protocol 2019-06-16 21:04:53 -07:00
Wez Furlong
55caafb0c4 more properly fix cond notify on Promise::drop 2019-06-16 21:04:53 -07:00
Wez Furlong
d061303bb4 don't forget to copy in the configured color palette! 2019-06-16 14:49:54 -07:00
Wez Furlong
797c7bb41a clippy 2019-06-14 20:49:49 -07:00
Wez Furlong
99d6c12532 poll the client tab asynchronously
Restructure the poll routine so that we don't block the gui thread
while we wait for the render data to be returned from the server.
2019-06-14 20:30:45 -07:00
Wez Furlong
036ff424f0 futurify the client methods, make key presses async 2019-06-14 19:44:20 -07:00
Wez Furlong
13640d565a assume openssl by default on !macos unix platforms 2019-06-14 16:37:12 -07:00
Wez Furlong
4089adba20 disable nagling, saves ~100ms latency 2019-06-14 08:30:24 -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
83de1117ff add tls mux client
The latency is not great, and there are more authentication and
authorization features that need to be added, but this shows that
we can connect and talk to a remote muxer.
2019-06-14 06:40:02 -07:00
Wez Furlong
16bcf7cf54 make client generic over Read+Write rather than UnixStream 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
b673dfd4d7 fixup some warnings, rename mux related flags 2019-06-13 21:53:14 -07:00
Wez Furlong
1d44098747 add cli command to list tabs 2019-06-13 21:53:14 -07:00
Wez Furlong
1ec8575da5 make ClientSession generic over Read+Write 2019-06-12 23:35:32 -07:00
Wez Furlong
74717744ba Remove perssimstic do_paint call
This do_paint call was added in 8995974124
but I don't think it was intentional; it looks like an accidental commit
of something during debugging.

The intent is that we tick over and paint every tick (~50ms) and this
behavior here was causing us to paint after every input event, which is
undesirable when processing the selection.

refs: https://github.com/wez/wezterm/issues/33
2019-06-12 08:21:25 -07:00
Wez Furlong
b31e9ecb56 allow skipping mux permission check
When using WSL, we want to place the unix socket on NTFS and that
reports an insecure set of permissions which cause us to refuse
to start up.

As a bit of a gross hack, allow skipping that check by setting an
environmental variable:

```
WEZTERM_SKIP_MUX_SOCK_PERMISSIONS_CHECK= wezterm start --front-end muxserver
```

that works best in conjunction with this in the WSL `.wezterm.toml`
file: (swap `wez` with your username):

```
mux_server_unix_domain_socket_path = "/mnt/c/Users/wez/.local/share/wezterm/sock"
```

refs: https://github.com/wez/wezterm/issues/33
2019-06-12 07:39:28 -07:00
Wez Furlong
a2b52eb777 remove IsTabDead rpc; can infer it from poll 2019-06-12 07:05:38 -07:00
Wez Furlong
a63784e19a fix linux compilation 2019-06-11 08:45:01 -07:00
Wez Furlong
abe656f51a when attaching, don't spawn a new window unless nothing attached 2019-06-11 08:40:30 -07:00
Wez Furlong
7b7258d410 plumb title for mux tabs 2019-06-11 08:35:07 -07:00
Wez Furlong
a7306f520a improve window<->tab management in spawn and mux
spawn now requires that the window_id be passed in; this makes it
a bit easier to spawn a remote tab into an existing window.
As part of this, beef up how we manage the window/tab association.
2019-06-11 08:23:21 -07:00
Wez Furlong
7456c06028 basically working attach to remote tabs/windows
The Domain::spawn interface needs to be adjusted to allow indicating
which window we want to spawn into, or whether the spawn should
create a new window, but aside from that, we can now attach to
a mux server and instantiate tabs and windows!
2019-06-11 06:48:19 -07:00
Wez Furlong
9b6800f589 we can now pass the clipboard back from the remote tab
So clicking to select now populates the clipboard
2019-06-10 08:13:14 -07:00
Wez Furlong
2ae68209b7 improve dirty line management in client tabs
This fixes up a case where a tab was closed and the screen
didn't repaint to show the now-current tab.
2019-06-10 07:57:08 -07:00
Wez Furlong
2a91921b6e poll more frequently 2019-06-10 07:49:55 -07:00
Wez Furlong
b5856cf474 clear dirty lines as part of obtaining the coarse data 2019-06-10 07:45:04 -07:00
Wez Furlong
abd81d1c01 slightly improve cpu usage by limiting poll frequency
The client domain stuff is now what I'd describe as almost
basically functional.  It's not a great experience because
the latency is a bit high (it uses the coarse render data
as a proof of concept, and polls that every 100ms), and doesn't
connect the clipboard to the remote session.  It also doesn't
enumerate and instantiate tabs for existing tabs on the remote
server, and doesn't have a way to gracefully detach from the
remote.

However, it is possible to connect and spawn tabs and interact
with them.
2019-06-10 07:27:35 -07:00
Wez Furlong
f95cdfad0e clippy 2019-06-09 21:15:43 -07:00
Wez Furlong
70579b45b7 improve error handling in mux codec 2019-06-09 21:00:00 -07:00
Wez Furlong
24559d508f fix a couple of warnings 2019-06-09 18:00:46 -07:00
Wez Furlong
8b6317ba19 add resize to clienttab 2019-06-09 17:59:41 -07:00
Wez Furlong
d00eb0cab4 implement client side send paste 2019-06-09 16:39:54 -07:00
Wez Furlong
86cd39eb4e we can now send input to a client tab 2019-06-09 16:33:57 -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
46fb1fe40c we can now see the remote tab rendered via the muxed domain 2019-06-09 13:38:19 -07:00
Wez Furlong
ee54864d6a allow writing to a muxed tab 2019-06-09 13:00:36 -07:00
Wez Furlong
661daa4f77 add stub renderable for muxed tab 2019-06-09 12:44:22 -07:00
Wez Furlong
e55233aa3d add option to use mux domain 2019-06-09 11:41:47 -07:00
Wez Furlong
18d5814b4f add stub for muxed tab 2019-06-09 11:35:17 -07:00
Wez Furlong
a89373be63 make mux traits Downcast-able 2019-06-09 11:14:43 -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
bfdeca4b79 start building out the muxed client Domain 2019-06-09 10:58:52 -07:00
Wez Furlong
e98d8acb96 add spawn rpc 2019-06-09 08:15:37 -07:00
Wez Furlong
0a1dd49409 more dyn courtesy of cargo +nightly fix 2019-06-09 07:44:02 -07:00
Wez Furlong
8055957406 clippy 2019-06-09 07:33:00 -07:00
Wez Furlong
92917a3a66 use PtySize in Tab::resize interface 2019-06-09 06:53:24 -07:00
Wez Furlong
c8ad858a29 connect domain id to spawn_tab
Even though we currently only have a single domain, we're now able
to spawn tabs in alternate domains.
2019-06-08 21:31:33 -07:00
Wez Furlong
87e7a7089c assign domains ids and associate tabs with them
The idea is that we can use this to spawn a tab in a
specific domain.  For example, "spawn tab in domain of current tab"
or "spawn tab in default domain".
2019-06-08 21:30:54 -07:00
Wez Furlong
5ebad9e63a dyn everywhere 2019-06-08 21:28:11 -07:00
Wez Furlong
f41c62c07b another linux build fix 2019-06-08 18:46:53 -07:00
Wez Furlong
68d5287acb fixup linux build 2019-06-08 18:25:12 -07:00
Wez Furlong
75a950328a tweak log level for ignored freetype error 2019-06-08 15:40:57 -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
000c5eddac Add CloseCurrentTab key binding
Added CMD-W as a default binding for this action.

refs: https://github.com/wez/wezterm/pull/26
2019-06-08 10:27:45 -07:00
Wez Furlong
9d13429fc9 refactor default key assignment, add CMD-M to Hide
refs: https://github.com/wez/wezterm/issues/32
2019-06-08 09:16:59 -07:00
Wez Furlong
f10e59245e add Hide/Show key actions
Usage example is to put this in your `wezterm.toml` to get the
macOS CMD-M shortcut for minimizing a window:

```
[[keys]]
key = "m"
mods = "CMD"
action = "Hide"
```

Refs: https://github.com/wez/wezterm/issues/32
2019-06-08 08:37:50 -07:00
Wez Furlong
3b94cddf8e allow specifying key bindings in wezterm.toml
refs: https://github.com/wez/wezterm/issues/32
2019-06-08 08:28:34 -07:00
Wez Furlong
45596f44be refactor key handling; add KeyAssignment
This is a step towards having configurable key bindings
refs: https://github.com/wez/wezterm/issues/32
2019-06-07 21:53:44 -07:00
Wez Furlong
024e1afcda move CMD-N new window dispatch into guicommon
This was blocked by some awkwardness in figuring out which
gui frontend was in use and queueing up the spawn and then
more ugliness in glutin.

That has subsequently been sorted out with the newer executor
stuff, so cut this over.

This is a tiny baby step towards a bigger key binding config
and thus refs: https://github.com/wez/wezterm/issues/32
2019-06-07 20:43:13 -07:00
Wez Furlong
12d49980c8 speculative fix for linux build 2019-06-04 21:34:09 -07:00
Wez Furlong
0c8cba99af centralize calling Mux::add_tab to Domain::spawn 2019-06-04 08:11:55 -07:00
Wez Furlong
95d2479ea6 gui_executor is intended to be obtainable from any thread 2019-06-04 08:11:55 -07:00
Wez Furlong
d4bc053493 Add Mux::default_domain and use it
This tidies up the various spawning call sites and
reduces some code duplication too!
2019-06-04 08:11:55 -07:00
Wez Furlong
f642bd56d6 introduce mux Domain concept
All locations that were setting up ptys now do so via the
Domain concept.  We still need a way to set up a persistent
global domain.
2019-06-04 08:11:55 -07:00
Wez Furlong
74bbf01014 fix 'already borrowed' panic with large pastes 2019-06-02 13:00:30 -07:00
Wez Furlong
bf719caaf3 allow using cmd-v to paste on linux
This is useful in a vmware vm on macos
2019-06-02 07:44:22 -07:00
Wez Furlong
71fd9c3ed7 thread palette through on each render call
This is slightly inefficient in that it copies the palette
for each call, so may want to revisit this if things feel
sluggish.
2019-06-01 16:07:08 -07:00
Wez Furlong
2ec436a4b9 make the frontends get the palette from the terminalstate
This isn't complete because it only copies it at startup
into the renderer.
2019-06-01 16:01:00 -07:00
Wez Furlong
038100922a clippy 2019-05-26 12:49:10 -07:00
Wez Furlong
607e180122 Range::contains is now stable; use it. 2019-05-26 11:40:33 -07:00
Wez Furlong
3f48387079 fixup mac build for extern crate changes 2019-05-26 09:21:58 -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
f87901c484 tidy up some failure usage 2019-05-26 08:58:59 -07:00
Wez Furlong
a05bca460e fixup unused doc comment warning 2019-05-26 07:59:39 -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
c207142bcf Improve performance on windows
I noticed that things were feeling laggy in general and when I
added some debugging prints I noticed that we were getting a
continuous stream of CursorMoved events with the same coordinates
while the window had focus.

This diff short circuits mouse processing in that situation and
makes things feel a bit more snappy.
2019-05-18 19:15:04 -07:00
Mark Thomas
073f9fb1f8 use AtomicUsize::new(0) instead of ATOMIC_USIZE_INIT
Replace ATOMIC_USIZE_INIT with AtomicUsize::new(0) as the constant has been
deprecated in favour of calling the constructor.
2019-05-05 06:57:32 -07:00
Wez Furlong
70593c215f Prevent resizing smalling than 1x1
Fixes https://github.com/wez/wezterm/issues/25
2019-05-04 09:18:43 -07:00
Wez Furlong
9646e035df don't self deadlock when processing a lot of eg: resize events
This is fixed by allowing the gui thread to use an unbounded queue
of spawned functions, and keeping non-gui-threads bounded.
2019-05-04 09:07:43 -07:00
Wez Furlong
736f617f13 make the window close button kill the current tab 2019-03-25 22:14:19 -07:00