1
1
mirror of https://github.com/wez/wezterm.git synced 2024-12-27 15:37:29 +03:00
Commit Graph

50 Commits

Author SHA1 Message Date
Wez Furlong
c2100d96c3 wezterm: Implement basic splits in the UI.
This commit provides the heart of the split functionality.
It adds a couple of key assignments (that are not finalized)
for splitting the active pane horizontally or vertically.

Clicking in a pane will activate it.
Selection is constrained to the active pane.
Resizing a window will grow/shrink the right/bottom side of a split.
The scrollbar applies to the active split.

There's not yet a way to resize a split at all.
There's not yet a key assignment for changing the active split.

The software renderer doesn't know how to render the splits correctly.

refs: https://github.com/wez/wezterm/issues/157
2020-09-22 22:12:11 -07:00
Wez Furlong
3d54a542bf wezterm: add PaneNode tree to Tab
This expands the data model for Tab so that it can record a binary
tree of panes; this allows for conceptually splitting a Pane either
horizontally or vertically.

None of the other layers know about this concept yet.

refs: https://github.com/wez/wezterm/issues/157
2020-09-20 08:27:44 -07:00
Wez Furlong
a6316315bb wezterm: introduce concept of Pane to the Mux model
This adds an extra level of indirection to the Mux model;
previously we allowed for Windows to contain an ordered
collection of Tabs, where each Tab represented some kind
of pty.

This change effectively renames the existing Tab trait to Pane
and introduces a new Tab container, so the new model is that
a Window contains an ordered collection of Tabs, and each Tab
can have a single optional Pane.

refs: https://github.com/wez/wezterm/issues/157
2020-09-20 08:27:32 -07:00
Wez Furlong
d547d938d8 term: rename crate to wezterm-term in advance of publishing
Add some more docs and remove a couple of dead bits of code.
2020-06-13 09:55:16 -07:00
Wez Furlong
cb6944f5eb wezterm: add buffer to termwiztermtab
I noticed that the launch menu was a bit flickery when moving
the mouse around, and I think a buffer will help.
2020-06-05 18:03:19 -07:00
Wez Furlong
82261ff16d wezterm: enable scrollback in the error window
This commit doesn't do anything specific to scrollback though!
It moves the implementation of the TermWizTermTab away from
a directly manipulated Surface and over to using the term::Terminal,
making the renderer look more like the one used by the local tab
and domain implementation.

As a side effect of doing this, we get scrollback management
for free.

refs: https://github.com/wez/wezterm/issues/201
2020-06-03 08:45:03 -07:00
Wez Furlong
cb3606d130 term: remove TerminalHost from api
This simplifies a bunch of things
2020-05-30 07:53:50 -07:00
Wez Furlong
e65c138231 wezterm: fix copy and paste from tab overlays
The root cause of this was that the dirtyness test always considered
the display to be changed and was clearing the selection to ensure
visual consistency.

This was actually a stealthy bug where we'd use more CPU and memory
than we strictly needed.

closes: https://github.com/wez/wezterm/issues/189
2020-05-23 11:18:32 -07:00
Wez Furlong
d39c16c406 wezterm: check for new releases
This commit adds some plumbing that will use the github API to
probe the currently released version of wezterm, and if it is
newer than the running version, show a window with some release
information and links to the changelog and download page.

The checks can be disabled in the config (but require a restart
to take effect!) and default to checking every 24 hours.

If running an AppImage on linux, links directly to the appimage
download.  In the future I'd like to have the download button
use zsync to apply the update to the local image.
2020-05-08 22:18:31 -07:00
Wez Furlong
bb9504d626 wezterm: make config error window a singleton
This fixes an annoyance with the configuration error window;
previously we would spawn a new window for each error that
was discovered in the config, which cluttered up the screen
and felt irritating when iterating on the config file.

This commit reuses the connection status UI infra to make a
single persistent error log window.
2020-04-12 10:33:31 -07:00
Wez Furlong
79007d9c33 termwiz: line editor: allow custom editor actions
This restructures the LineEditor to allow the hosting application to
override key presses and apply custom edits to the editor buffer.

Methods for performing predefined actions and for accessing the line
buffer and cursor position have been provided/exposed to support this.

One consequence of this change is that the editor instance needs to be
passed through to the host trait impl and that means that the LineEditor
can no longer be generic over `Terminal`.  Instead we now take `&mut dyn
Terminal` which was how the majority of non-example code was using it in
any case.  This simplifies a bit of boilerplate in wezterm but adds an
extra line to the most basic examples.
2020-04-09 07:37:23 -07:00
Wez Furlong
e7d8068ad9 connui: add a sleep_with_reason method
This is used to indicate timeout/retries during connection establishment
and also to count down to the automatic window close.

The UI will render a progress bar underneath the reason text to show
the passage of time, as well as counting down the provided duration.
2020-03-08 10:00:08 -07:00
Wez Furlong
2debfcc624 remove some debug output 2020-03-03 07:51:47 -08:00
Wez Furlong
dc3f2f0572 add launcher overlay
This is accessible by right-clicking on the `+` button in the tab bar
and switches to an overlay offering options to spawn tabs and attach
domains.

The intent is to allow the configuration file to expand this list of
options, and on Windows, to auto-populate with the various combinations
of `cmd`, `powershell`, `elevated` and available `wsl` instances, but
for the moment the main value of this feature is the ability to attach
domains that were not set to connect automatically at startup.

This makes things more convenient when launching wezterm via the
gui: it is awkward to have to set up shortcuts that run
`wezterm connect foo`, or to type in the full path to `wezterm` when
you might want to run that manually.

Now you can double-click the icon and right-click the `+` and attach
the domain. (cc: @rjwalsh)

The launcher is a good candidate for being implemented on top of
native context menus where available... but we don't have any
such API plumbed through the `window` crate, so all platforms
get the wonderful terminal based overlay menu right now.

refs: https://github.com/wez/wezterm/issues/159
2020-03-02 09:12:58 -08:00
Wez Furlong
3940684b4e respect color scheme for termwiz derived tabs 2020-01-25 17:18:45 -08:00
Wez Furlong
0822c67e32 overlay: initial prep
An overlay is a little termwiz app that can be overlaid over the
content of a gui tab.

The intent is for these to provide the mechanism for meta operations;
listing all tabs in a long-form list and switching between them,
dropping into configuration or error log review and so on.
2020-01-25 17:18:45 -08:00
Wez Furlong
fd8f28960f ssh: use a single window for authenticating a session
This makes it so that we preserve context while showing the connection
status and authentication prompts.
2020-01-25 13:00:16 -08:00
Wez Furlong
b59893fd9f ssh: allow a number of auth retries
Rather than just a single attempt at each mechanism, let's allow up
to 3 loops, each time trying all supported mechanisms.  This helps
for the case where the user makes a typo with their password, and
should also help for more complicated auth setups where succeeding
with one mechanism may not be sufficient.

While testing this out I noticed that were deferring closing the
OS level window until after the entire auth attempt, so I added
some logic to proactively close the prompt windows.  In the longer
term I'd like all related prompts to render in the same window
for improved cognotive continuity.
2020-01-24 08:39:34 -08:00
Wez Furlong
894e971e25 Show a window with the full error message for failed config load
This is a very basic first approximation for the feature discussed
in the associated github issue.

Refs: https://github.com/wez/wezterm/issues/80
2020-01-17 18:47:02 -08:00
Wez Furlong
e814bc4267 mux: Domain::spawn is now async
This was another source of hanging on windows with connecting to a unix
domain.
2020-01-16 16:36:27 -08:00
Wez Furlong
7de282fd07 mux: make Domain::attach an async fn 2020-01-16 15:55:15 -08:00
Wez Furlong
aeb91ff238 migrate more things over to the new spawn stuff 2020-01-16 10:31:53 -08:00
Wez Furlong
9ec4694d89 migrate some more code to the newer spawn mechanism 2020-01-16 09:15:07 -08:00
Wez Furlong
4b455288dd track the full current dir URL for OSC 7
Matching against the current dir when it includes a host and a
path seems like a handy way to automate selecting appropriate
theme/color/profile settings, so I'd like to make sure that
we have the full URL content available for that.

Refs: https://github.com/wez/wezterm/issues/115
Refs: https://github.com/wez/wezterm/issues/117
2020-01-14 22:06:13 -08:00
Jeremy Fitzhardinge
83641ed46c Spawn new tabs using the current tab's current directory
(If known.)
2020-01-11 18:25:17 -08:00
Jeremy Fitzhardinge
71eb27ccb5 Add get_current_working_dir to Tab 2020-01-11 18:25:17 -08:00
Wez Furlong
d76e4ed42d use RangeSet for the result of get_dirty_lines 2020-01-08 08:34:22 -08:00
Wez Furlong
41ee87f43c make Domain::attach return a Future
This avoids a hang on startup if you're using an ssh multiplexer
connection and haven't already registered your ssh key and need
to perform password authentication.
2020-01-06 22:41:59 -08:00
Wez Furlong
4687b3bb48 clippy 2020-01-05 15:14:32 -08:00
Wez Furlong
dfa2b08c72 move URL highlight processing to the gui layer 2020-01-05 14:37:17 -08:00
Wez Furlong
400c8aa66d remove explicit dirty manipulation from Renderable
This commit leaves mux domains broken for the moment,
but also simplifes the implementation of the renderable interface.
2020-01-05 14:37:17 -08:00
Wez Furlong
ed97a56055 remove viewport control from renderable trait
This is now handled 100% by the gui layer
2020-01-05 14:37:17 -08:00
Wez Furlong
1b925b593a fix reported scrollback size for surface based tabs 2020-01-05 14:37:17 -08:00
Wez Furlong
bcf3d8db35 remove some dead code 2020-01-05 14:37:17 -08:00
Wez Furlong
4912e83f3e StableCursorPosition to track the cursor
This fixes up the cursor position when scrolling.

refs: https://github.com/wez/wezterm/issues/106
2020-01-05 14:37:17 -08:00
Wez Furlong
1c716898e7 Remove viewport_offset from RenderableDimensions
refs: https://github.com/wez/wezterm/issues/106
2020-01-05 14:37:17 -08:00
Wez Furlong
6183434bda Track viewport in the gui layer
Use StableRowIndex to implement tracking the viewport in the gui layer.
This resolves an issue where a busy terminal would continue to scroll
through the scrollback when you were paging backwards and look weird.

There's still some cleanup though:

- This breaks the selection ui
- the cursor position is wrong when scrolling back
- shift-pageup/pagedown need to be processed in the gui layer

Refs: https://github.com/wez/wezterm/issues/106
2020-01-05 14:37:17 -08:00
Wez Furlong
5f5113ce50 Renderable: fold get_scrollbar_info into get_dimensions 2020-01-05 14:37:17 -08:00
Wez Furlong
5ba0c70cdb add Tab::is_mouse_grabbed concept
refs: https://github.com/wez/wezterm/issues/106
2020-01-05 14:37:17 -08:00
Wez Furlong
f1846ab0ae add Renderable::get_lines
This allows retrieving arbitrary lines from the scrollback

refs: https://github.com/wez/wezterm/issues/106
2020-01-05 14:37:17 -08:00
Wez Furlong
56c170240f Renderable: replace a 2-tuple with an expanded struct
This cleans up the API a little as part of
refs: https://github.com/wez/wezterm/issues/106
2020-01-05 14:37:17 -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
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
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
15a86b77bd replace most tinyfiledialogs usage with our own prompts 2019-11-08 21:11:22 -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