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

188 Commits

Author SHA1 Message Date
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
7d510f4f7e reduce log verbosity for compute vertices 2019-12-01 11:43:22 -08:00
Wez Furlong
0edceea972 fix compilation on macos 2019-12-01 10:16:14 -08:00
Wez Furlong
f15f556054 wayland: add config option to avoid using it
Just in case!
2019-12-01 07:56:41 -08:00
Wez Furlong
58cb696593 make pty size consistent with tab bar dimensions
This fixes up a series of "we're confused about the screen size"
messages that showed up on startup.
2019-11-30 23:22:37 -08:00
Wez Furlong
68f819e737 avoid resizing terminal tab when scaling changes 2019-11-30 22:03:57 -08:00
Wez Furlong
70f09ef1b4 fix window size calculation when scaling changes
I noticed that we were relatively undersized for newly created
windows; there were two problems:

1. We weren't propagating the old rows and cols counts through
   to the speculative resize.
2. The speculative resize wasn't implemented on wayland, and
   needs a surprising amout of work to actually make the resize
   take effect.
2019-11-30 21:27:03 -08:00
Wez Furlong
ea61e8c57d wayland: don't allow clicks in titlebar to go to tabbar 2019-11-30 13:21:37 -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
7b461c1580 software: don't fill the bottom two lines in bg color
Fix the math so that we correctly calculate the size of the the
marginal fill area at the bottom when in software rendering mode.
2019-11-28 07:16:46 -08:00
Wez Furlong
cb9fd7db5b respect enable_tab_bar on config reload 2019-11-24 20:33:14 -08:00
Wez Furlong
95c957564a reload keymap when config is reloaded 2019-11-24 17:25:28 -08:00
Wez Furlong
e56dfa9875 config reloading now also applies to fonts
This change also causes any/all windows to pick up the reloaded config
2019-11-24 10:24:33 -08:00
Wez Furlong
88cd29213f Add hotkey (defaults: SUPER-R, and CTRL+SHIFT-R) to reload config
The effects are most noticeable when spawning a new tab;
try changing the background color in the config file,
reloading it and spawning a tab!
2019-11-24 09:27:31 -08:00
Wez Furlong
d06c08e0f3 config: expose configuration generation number 2019-11-24 09:19:14 -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
517084ff2f clippy 2019-11-24 07:20:41 -08:00
Wez Furlong
f3f61b47dc tab bar: add new tab button to tab bar 2019-11-23 14:57:17 -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
1737ca4d80 fix subtraction overflow when creating a new window when tab bar enabled 2019-11-22 04:51:55 +00: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
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
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
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
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
6da7b3ecd0 internalized password/auth UI for ssh
This is a bit of a large commit because it needed some plumbing:

* Change mux creation to allow deferring associating any domains,
  and to change the default domain later in the lifetime of the
  program
* De-bounce the empty mux detection to allow for transient windows
  during early startup
* Implement a bridge between the termwiz client Surface and the
  frontend gui renderer so that we can render from termwiz to
  the gui.
* Adjust the line editor logic so that the highlight_line method
  can change the length of the output.  This enables replacing
  the input text with placeholders so that we can obscure password
  input
2019-11-08 19:55:12 -08:00
Wez Furlong
3b93442590 config: add send_composed_key_when_alt_is_pressed option
On macos, allow sending eg: ALT-F as ALT-F rather than the composed
graphics character (ƒ) that is the default for that combination in
the macos IME.

This is controlled by a new config option which defaults to false
so that we have the expected terminal behavior by default.
2019-11-05 22:29:22 -08:00
Wez Furlong
eb1bc7f736 allow binding opt + key based on pre-composed key presses
This diff adds some plumbing to track the `raw_key` in the KeyEvent;
this is the key prior to composing or eg: mapping dead keys.

With that field in place, we can teach the termwindow layer to attempt
looking up that key mapping from the user defined key bindings.

If we get a match then we can stop further key processing.
2019-11-05 21:32:23 -08:00
Wez Furlong
e288ecce7c windows: avoid panic when clicking on links
The `open` crate causes us to recurse into our wndproc and re-borrow,
so avoid that and schedule a separate call later.
2019-11-04 08:56:11 -08:00
Wez Furlong
cb5e351187 macos: try to set the IME cursor position a bit better
Use the current terminal cursor position as the basis for the position
of the IME.
2019-11-04 00:11:27 -08:00
Wez Furlong
c99e2989ef Fix ctrl-J processing
The front-end was treating both \r and \n as Enter and passing
that through to the terminal.

To verify behavior, pay attention to your termios configuration:

```
$ stty -icrnl
$ od -c
<CTRL-J><CTRL-D>
0000000   \n
0000001
$ od -c
<CTRL-M><CTRL-D><Enter>
0000000   \r  \n
0000002
```

Closes https://github.com/wez/wezterm/issues/56
2019-11-03 22:01:35 -08:00
Wez Furlong
047a58a6e9 improve error messages when shaping 2019-11-02 16:43:09 -07:00
Wez Furlong
2120b1e2ee fix shift-insert paste on windows
... by filling out the complete mapping between the keycode enums
2019-11-02 13:24:31 -07:00
Wez Furlong
d0f2204bdd factor out color conversion to match software renderer 2019-10-29 08:42:38 -07:00
Wez Furlong
7ecee7a5d6 defer calling window.show until after probing/enabling opengl 2019-10-29 08:42:38 -07:00
Wez Furlong
a9940ca56f remap Char codes to termwiz input codes
refs: https://github.com/wez/wezterm/issues/53
2019-10-28 14:31:10 -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
01669266f2 rename SoftwareFrontend to GuiFrontend
It started out as a software only cpu renderer but grew into the
current gui frontend; rename to reflect that.
2019-10-27 23:31:44 -07:00
Wez Furlong
728df5662d move localtab out from old guicommon module 2019-10-27 23:31:44 -07:00
Wez Furlong
8bfd92bbfc move clipboard out from old guicommon module 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
4e01dec636 font scaling now also resizes the window for opengl+software frontend 2019-10-27 17:48:02 -07:00
Wez Furlong
a0f6db85cb tweak color emoji descender handling 2019-10-27 13:44:06 -07:00