Commit Graph
142 Commits
Author SHA1 Message Date
Wez Furlong aac93e7f0a Improve palette handling w/ live config reloading
@fanzeyi ran into part of this issue when using multiplexing;
tabs from a remote domain always used the default color scheme
rather than the local configuration file color scheme.

Another variation on this is that making changes to the `[colors]`
section of the config only impacts tabs created after the change
was loaded, rather than updating the running tabs.

The root of this was that each terminal was keeping its own
copy of the palette that was updated at creation time to reflect
the config file.  Relatively recently I introduced a new trait
to allow the terminal state to reach out and obtain configuration
from another source.

This commit connects the terminal configuration layer to the
configuration file directly.

The color schemes are now pulled directly from the configuration
file, except in the case where a dynamic color scheme has been
applied: using escape sequences to change the colors causes
the palette to be forked away from the configuration file.

There's still a low pri TODO around this space: if we're connected
to a remote domain and someone uses dynamic color scheme escapes,
should we reflect those locally?  If so then we'll need to build
some plumbing to transport the palette to/from the remote system.

Closes: https://github.com/wez/wezterm/pull/60
2019-12-23 14:19:48 -08:00
Wez Furlong f28d9e994f Enable mouse interaction with scroll bar
This commit:

* Removes the ability to drag the window by the tab bar.  I added
  that in anticipation of needing to do custom title bar dragging
  with Wayland, but it turned out both to be not required and not
  possible to drag windows around in that way.
* Replaces the drag logic with dragging the scrollbar thumb
* Clicking above the scrollbar thumb is equivalent to page up
* Clicking below the scrollbar thumb is equivalent to page down
2019-12-22 22:01:00 -08:00
Wez Furlong ec609a2e41 Add optional scroll position UI
This commit adds a scrollbar that shows the scroll position but
that does not currently allow dragging to scroll.

The scrollbar occupies the right hand side window padding.

The width of the scrollbar can be set by explicitly configuring
`window_padding.right`.  If the right padding is set to 0 (which
is its default value), and the scroll bar is enabled then the cell
width will be used for the right padding value instead.

The scrollbar can be enabled/disabled via this config setting:

```
enable_scroll_bar = true
```

Its color by this:

```
[colors]
scrollbar_thumb = "#444444"
```

(Note that color palette config will be reloaded when the config
file is changed, but you'll need to spawn a new tab/window to
see the effects because we cannot assume that a config reload should
always replace a potentially dynamically adjusted color scheme in
a tab).
2019-12-22 20:12:56 -08:00
Wez Furlong 5abc4e543e rendering now respects cursor visibility
This commit adds some plumbing for describing the cursor shape
(block, line, blinking etc) and visibility, and feeds that through
the mux and render layers.

The renderer now knows to omit the cursor when it is not visible.
2019-12-22 08:52:51 -08:00
Wez Furlong 9a2c7a1485 failure -> anyhow + thiserror 2019-12-14 21:43:05 -08:00
Wez Furlong 988e996a76 fonts: remove font_system selection type
This simplifies things a bit by removing some boiler plate.
We can now control locator, shaper and rasterizer independently.
2019-12-09 13:35:38 -08:00
Jeremy Fitzhardinge 0558662813 Convert chit-chat into info
I assume it was being printed as error from a mass conversion to the logging framework.
2019-12-06 15:11:42 -08:00
Wez Furlong 901dc9c395 re-structure clipboard handling for mux
The wayland changes rendered clipboard handling for remote multiplexers
broken, and this commit makes it work again.

It removes the clipboard concept from the the TerminalHost and
keeps it separated as the term::Clipboard concept.

The muxer now has plumbing for passing the Clipboard to its idea
of Windows and Tabs and this is hooked up at window creation and
domain attach time.
2019-12-01 13:31:12 -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 80719f419d changes to ratelimits now take effect on config reload 2019-11-24 20:24:58 -08:00
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 385b3bedbd move some config defaults into the config module 2019-11-24 06:56:41 -08:00
Wez Furlong 5370e88520 implement explicit Copy keybinding action
previously we would only ever copy to the clipboard when the selection
was changed.

Now we respect the Copy keypress and have it re-copy the selection
into the clipboard.
2019-11-11 08:54:47 -08:00
Wez Furlong 155a972425 add missing selection normalize calls
I saw

```
thread 'main' panicked at 'you forgot to normalize a SelectionRange', term/src/selection.rs:94:9
```
2019-11-03 22:01:35 -08:00
Wez Furlong 7c844e8924 probably fixup build on windows for executor changes 2019-10-28 21:51:46 -07:00
Wez Furlong c8f39b9adf simplify executor acquisition 2019-10-28 08:16:36 -07:00
Wez Furlong 29e4843517 move away from explicit executor.clone_executor() calls
call the gui_executor() function instead
2019-10-28 08:11:06 -07:00
Wez Furlong 8bfd92bbfc move clipboard out from old guicommon module 2019-10-27 23:31:44 -07:00
Wez Furlong 52a65370fa cargo fmt with rust 1.38 2019-09-28 21:40:40 -07:00
Wez Furlong 86ba590ead fixup some missing dyn 2019-09-21 13:36:15 -07:00
Wez Furlong 24f6d90ccf improve error reporting for mux-over-ssh 2019-08-06 18:55:55 -07:00
Wez Furlong 567f3c4c0b remove muxed prefix from mux client title bar 2019-08-06 08:33:01 -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 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 b46dbe60ba use $USERNAME on windows when defaulting ssh user 2019-08-05 09:35:30 -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 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 7e50c4db68 workaround conpty drop issue 2019-07-17 08:42:41 -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 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 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 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 33f17eaf3f remove WEZTERM_SKIP_MUX_SOCK_PERMISSIONS_CHECK env var in favor of config value 2019-06-22 11:01:17 -07:00