1
1
mirror of https://github.com/wez/wezterm.git synced 2024-09-20 11:17:15 +03:00
Commit Graph

5142 Commits

Author SHA1 Message Date
Wez Furlong
631f7869a5 launcher: consistently order entries 2022-01-16 20:59:51 -07:00
Wez Furlong
b6141d650e launcher: improve scrolling through options and mouse selection
Make the scrolling mostly independent of the active row; adjust
the top row when hitting the top/bottom edges of the display.

Mouse movement no longer changes the scroll position.  Instead,
the wheel is used to scroll the list.

refs: https://github.com/wez/wezterm/issues/1485
2022-01-16 20:28:46 -07:00
Autumn Lamonte
d3df2920d0
Filter out per-pixel mouse movement when not in SGR-Pixels mode (#1549)
* #1457 Initial commit compiles but doesn't yet work

* #1457 Fix cell offsets

* #1457 refactor, ClickPosition

* fix nits

* #1457 filter per-pixel motion when not in SGR-Pixels mode

* Much cleaner match condition for filtering mouse events based on encoding protocol
2022-01-16 19:31:56 -07:00
Wez Furlong
11567c2097 ci: put fmt check into separate workflow 2022-01-16 19:07:47 -07:00
Wez Furlong
4b457da62f cargo fmt 2022-01-16 18:48:26 -07:00
Wez Furlong
6c19e5af5f cargo update 2022-01-16 18:46:30 -07:00
Wez Furlong
d164178b9d docs for wezterm.nerdfonts
refs: https://github.com/wez/wezterm/issues/1521
2022-01-16 18:45:13 -07:00
Wez Furlong
54e92b6858 Add module to map nerd font symbol names to codepoints
I generated nerdfonts_data.rs with this shell script; it uses `i_all.sh`
from the nerdfonts repo to get the base mapping:

```
source ./lib/i_all.sh

echo "//! Data mapping nerd font symbol names to their char codepoints"
echo "pub const NERD_FONT_GLYPHS: &[(&str, char)] = &["
for var in "${!i@}"; do
  # trim 'i_' prefix
  glyph_name=${var#*_}
  glyph_char=${!var}
  glyph_code=$(printf "%x" "'$glyph_char'")
  echo "(\"$glyph_name\", '\u{$glyph_code}'), // $glyph_char"
done
echo "];"
```

Then intent is to use it in wezterm:

```
local wezterm = require 'wezterm'

wezterm.log_info(wezterm.nerdfonts.dev_mozilla)
```
2022-01-16 17:25:08 -07:00
Wez Furlong
070c4030c6 Bundle Symbols Nerd Font Mono
Built using:

```
./FontForge-2020-11-07-21ad4a1-x86_64.AppImage --script $PWD/font-patcher "$PWD/src/unpatched-fonts/NerdFontsSymbolsOnly/NerdFontsSymbolsOnly Template 1000 em.ttf" --powerline --use-single-width-glyphs -out /tmp/nerd-fonts-out --fontawesome --fontawesomeextension --fontlinux --octicons --codicons --powersymbols --powerline --powerlineextra --mdi --weathericons
```

which is everything *except* Pomicons at the time of writing, pending
clarifications of its distribution license
(https://github.com/ryanoasis/nerd-fonts/issues/266)

refs: https://github.com/wez/wezterm/issues/1521
2022-01-16 16:04:35 -07:00
Wez Furlong
3ee9270e3c support MarkEndOfPromptAndStartOfInputUntilEndOfLine semantic mode
It's a little ambiguous whether we should cancel the mode when moving
the cursor explicitly; I opted to do it when we move it due to newline
processing, or when its y position is changed.

refs: #1539
2022-01-16 12:49:19 -07:00
Wez Furlong
c6acd544ed docs: document tab bar edge option
closes: #1547
2022-01-16 12:24:38 -07:00
Wez Furlong
25c0540875 fix bar cursors when moving through double-width cells
Don't render two copies of the cursor in the same cell,
and compute different graphics for double wide cells.

refs: #1548
2022-01-16 12:19:49 -07:00
Wez Furlong
71630844c8 fix warning 2022-01-16 09:53:34 -07:00
Wez Furlong
e575bc9ff9 simplify window reconciliation logic
refs: https://github.com/wez/wezterm/issues/1531
2022-01-16 09:50:16 -07:00
Wez Furlong
12f32aeda8 tidy up front end accessors 2022-01-15 21:46:40 -07:00
Wez Furlong
39c2da3bdf avoid race condition when closing last window in a workspace
This isn't ideal, but it is better than previously: we would
close the window and before the Drop impl had updated the
list of known windows, we'd try to re-assign that window
to another mux window in a different workspace, but it would
never appear because the window was closed.

refs: https://github.com/wez/wezterm/issues/1531
2022-01-15 20:02:14 -07:00
Wez Furlong
093b448624 When switching workspaces, resize workspace to fit the window
Originally I had this the other way around but it was problematic
when considering things like maximized, font scaling and full screen
states.

refs: https://github.com/wez/wezterm/issues/1531
2022-01-15 19:33:29 -07:00
Wez Furlong
bb9290f431 launcher: avoid subtract with overflow panic 2022-01-15 19:33:02 -07:00
Wez Furlong
76a213f7ab Gui switches to a different workspace when current workspace is emptied
Rather than just quitting the app and potentially silently killing off
a number of panes that might be running in other workspaces, we now
will pick one of those workspaces and activate it.

refs: #1531
2022-01-15 14:41:19 -07:00
Wez Furlong
180e72a673 adjust help for wezterm cli spawn's --workspace parameter 2022-01-15 14:21:47 -07:00
Wez Furlong
aa52555fb8 add workspaces to launcher menu
refs: #1531
2022-01-15 14:16:41 -07:00
Wez Furlong
6ba9d7f72e Add --workspace parameter to most gui subcommands
These allow setting the initial workspace name
2022-01-15 14:01:30 -07:00
Wez Furlong
6d288696c8 Add SwitchToWorkspace keyassignment action
This action causes the active workspace for the gui to change.

If the name is omitted a random name will be generated.
If the workspace doesn't exist, it will be be created.
The optional spawn parameter can be used to launch a specific
program into the new workspace; if omitted, the default prog
will be used.

The gui only supports a single active workspace. Switching workspaces
will repurpose existing gui windows and re-assign them to windows
in the new workspace, adjusting their size to fit those windows,
spawning new windows or closing unused windows as required.

The gui now exits when there are no panes in the active workspace,
rather than no panes at all.

refs: #1531
2022-01-15 13:53:34 -07:00
Wez Furlong
626a022dd5 mux: function to list workspaces and generate a new name
refs: #1531
2022-01-15 08:46:21 -07:00
Wez Furlong
324815b625 mux: update last input time for local pane actions
This commit updates the last input time for the active client
id when calling into local pane.  That time is visible in the
`wezterm cli list-clients` output.
2022-01-15 07:03:20 -07:00
Wez Furlong
9a241509a4 mux: add current identity concept
The mux now has a notion of which client is actively doing things.
This allows, for example, newly spawned windows to take on the
active workspace for a given client.

The gui now assigns a client id on startup, and sets the active
workspace to `default`.

The mux server temporarily overrides the active id to that of
the currently dispatching client when processing PDUs.

refs: https://github.com/wez/wezterm/issues/1531
2022-01-15 06:25:11 -07:00
Wez Furlong
170bb31f4f refactor: move more spawn logic into new mux methods 2022-01-14 22:28:35 -07:00
Wez Furlong
30a9692f9d refactor: centralize some more spawn logic 2022-01-14 22:28:35 -07:00
Wez Furlong
e0fe1e7f04 mux: factor out common SpawnTabDomain resolution logic 2022-01-14 22:28:35 -07:00
Wez Furlong
31c754f6e4 refactor: move split_pane logic from mux server to mux 2022-01-14 22:28:35 -07:00
Wez Furlong
3947014bad refactor: decouple domain from cwd matching in spawn.rs
This will make it easier to re-use other spawn functions in a later
commit.
2022-01-14 22:28:35 -07:00
Wez Furlong
1704af88ba refactor: move logic -> Mux::spawn_tab_or_window
Tidies up some code duplication within the mux protocol handler.
Move some of the logic into Mux, remove legacy Spawn Pdu to reduce
more duplication.

I want to dedup some of the similar logic that exists in the gui
spawn implementation as well in a follow up.
2022-01-14 22:28:35 -07:00
Wez Furlong
1bc5c5a663 refactor: common spawn bits into Domain::spawn_pane
This a step towards decoupling split_pane from Domain.

refs: #1531
2022-01-14 22:28:35 -07:00
Wez Furlong
a9427aca63 Remove ALT-number default key assignments
The issue is that we work hard to match the keys pre-composition,
but for French and Norwegian layouts ALT-number are valid,
useful punctuation keys.  It's awkward to make exceptions for
ALT keys when matching assignments, especially on macOS, and
the simplest thing to do is simply to remove the assignments
and leave it to our users to add their own if they want them.

The ctrl-shift and cmd based assignments are generally much
easier to keep, because those key combinations are not widely
used default mappings on any keyboard layout.

refs: #1543
refs: #1542
refs: https://github.com/wez/wezterm/pull/1132
2022-01-14 22:24:40 -07:00
Wez Furlong
12de21df95 clarify debug_key_events logging
up/down events were ambiguous
2022-01-14 21:59:29 -07:00
Wez Furlong
91f8a341dd input: ALT-<number> default keys are now post-mapping assignments
This resolves some issues with non-US layouts (French, Norweigan)
where ALT-number are important and useful punctuation that we were
otherwise blocking.

This new behavior seems consistent with eg: vte terminals on linux
when switching to a French layout.

refs: #1543
refs: #1542
2022-01-14 08:49:34 -07:00
Chip Senkbeil
e46e2bae80
Add wezterm-ssh independent CI task to verify libssh-rs and ssh2 features can work independently (#1544)
Add wezterm-ssh independent CI task to verify libssh-rs and ssh2 features can work independently
2022-01-13 18:48:33 -07:00
Wez Furlong
b5dfbc392c make use_ime=true the default for all platforms
The key repeat issues that were blocking this from being enabled
on macos have been resolved.
2022-01-13 09:19:23 -07:00
Wez Furlong
507267aeee docs: changelog for https://github.com/wez/wezterm/pull/1534 2022-01-12 18:03:20 -07:00
Howard Huang
5b353df78e STYLE: Fix code format
Using `cargo fmt --all`
2022-01-12 17:01:38 -08:00
Howard Huang
e01f9c0e7d FEATURE: Allow ScrollByPage f64 values
`ScrollByPage` can accept non-integer values in the configuration.
This allows fractional page scrolling, such as by half a page.

The default remains the same, at 1 page.
2022-01-12 17:01:38 -08:00
Wez Furlong
35e921b9e6 input: fix alt-h on macos
We'd lost support for send_composed_key_when_X_alt_is_pressed;
this commit restores it.

refs: https://github.com/wez/wezterm/issues/1541
2022-01-12 16:47:08 -07:00
Wez Furlong
cefe45d206 Windows can be labelled with a workspace name
This is not exposed through any UX; the mux api allows setting
the workspace and propagating information about windows whose
workspace has changed.

Windows start with a blank workspace name.

This is just plumbing; nothing uses it yet.

refs: #1531
2022-01-12 16:47:08 -07:00
Wez Furlong
f6e56aab10 ci: tidy up termwiz workflow 2022-01-12 07:19:44 -07:00
Wez Furlong
4452fbe798 ci: trigger termwiz build on push as well 2022-01-12 07:16:16 -07:00
Wez Furlong
475fc0667b fix termwiz compilation when widgets are enabled
refs: #1457
2022-01-12 07:14:14 -07:00
Wez Furlong
9b9bd0ae8c mux: track list of clients
Define a way to compute a client ID and pass that through to the
mux server when verifying version compatibility.

Once associated, the session handler will keep some metadata
updated in the mux.

A new cli subcommand exposes the info:

```
; ./target/debug/wezterm cli list-clients
USER HOST              PID CONNECTED  IDLE      WORKSPACE
wez  mba.localdomain 52979 30.009225s 1.009225s
```

refs: #1531
2022-01-11 22:43:26 -07:00
Wez Furlong
e314d84711 wezterm connect unix could exit on startup
This is a similar race condition to one we had before with the
multiplexer, where the connection UI made us think that we didn't
need to start a new process.

Additionally, the attach method would unconditionally create a
new client without checking whether we already had one.
2022-01-11 22:35:31 -07:00
Wez Furlong
58d969e77c gui: Avoid 450ms delay on startup(!)
In the case that the published symlink is stale, our default
client connection logic was to retry connecting with backoff
to give a newly spawned server a chance to startup.

In the context of a newly launched gui process checking to see
if an existing gui process can serve the same request, we don't
need to give it any grace: it will either answer immediately
or be deemed not useful.

This commit limits us to a single connection attempt in the case
where we're not automatically starting the server, which in turn
constrains the overhead to something in the order of microseconds
rather than nearly 0.5 seconds.

While we're in here, I noticed that if we thought we had a socket
to try and that failed, we'd always try to publish a new symlink.
However, if we failed due to mismatched version info, we shouldn't
publish over the top of the already running instance.

refs: #1529
2022-01-10 20:31:01 -07:00
Wez Furlong
d1018c37ff docs: changelog for #1526 2022-01-10 18:56:57 -07:00