1
1
mirror of https://github.com/wez/wezterm.git synced 2024-11-25 21:07:39 +03:00
Commit Graph

536 Commits

Author SHA1 Message Date
Wez Furlong
e3e9821c4d
Add InputSelector action
Allows prompting the user to select from a list and then
triggering some action on the selected item.

This is the guts of the launcher menu hooked up to user-supplied
arbitrary entries.
2023-04-05 17:22:09 -07:00
Wez Furlong
336fefb52f
Add PromptInputLine and examples of (re)naming tabs/workspaces
refs: https://github.com/wez/wezterm/issues/522
refs: https://github.com/wez/wezterm/issues/1598
2023-04-04 21:11:08 -07:00
Wez Furlong
adcadca480
mux: increase default fetch throttle limit
I've seen a few warnings about hitting the throttle in vim
when running locally, raise the headroom a bit
2023-04-04 17:17:07 -07:00
Wez Furlong
4be2b9dbeb
make config_builder work with table.insert(config.keys, ...)
This had a referencing issue, similar to the more recent GLOBALS
issue.

The resolution in this case is a lot simpler: we can just return
a regular lua table and use all the same underlying semantics,
but stick a metatable over the top to handle assignment and
provide the strict mode method.
2023-04-04 11:43:21 -07:00
Jalil David Salamé Messina
b32863cc2f fix(clippy): Implement From instead of Into
Implementing `From` is prefered as this also implements the `Into` trait, may
not be desireable for code size/compilation time reasons.
2023-04-03 08:31:12 -07:00
Wez Furlong
d36ad7ca7f
mux: reduce volume of bonus lines sent by server
At 80x24 (< 2k cells), sending all 24 lines of the viewport as an
optimistic prefetch is "OK", but for full screen 4k (80*250 = 20k cells)
the volume is oversized and pushes latency up.

This commit dials that back down to the minimal useful data; the
cursor row + any changed rows in the viewport.  When navigating
in vim that reduces things down to 2 rows of prefetch per movement,
assuming that the status line is being updated to show the cursor
position.

This feels a little more snappy for me.

refs: https://github.com/wez/wezterm/issues/2503
refs: https://github.com/wez/wezterm/issues/1872
2023-04-02 16:26:11 -07:00
Wez Furlong
49296500da
mux: forward ClearScrollback requests to remote server
refs: #2624
2023-04-02 14:17:05 -07:00
Wez Furlong
25255d90d6
config: lazyily produce ssh domain list
I noticed that in debug builds, `wezterm set-working-directory` had
high/variable latency, and I traced part of it to the ssh config parsing
logic.

Make that lazily evaluate the ssh config.

refs: #3402
2023-04-02 10:34:46 -07:00
Wez Furlong
e000e91683
maybe fix freebsd build
rlim_t is signed on that platform, so take care to convert
to appease the compiler.
2023-04-02 06:36:46 -07:00
Wez Furlong
8582165ffc
add display_pixel_geometry config option for subpixel geometry
refs: #3422
2023-04-01 11:05:09 -07:00
Wez Furlong
28417ada78
font: minor refact to derive Default for FreeTypeLoadTarget 2023-04-01 10:46:38 -07:00
Wez Furlong
929e86225d
cheaper case insensitive compare 2023-03-31 21:52:54 -07:00
YuraIz
ab52277393
integrated-title-bar: Replace window button recoloring
also change shape of rounded corners to ovals
2023-03-31 19:59:01 -07:00
YuraIz
01aeb506c0
integrated-title-bar: Update config options
and rename the "FANCY" option to "INTEGRATED_BUTTONS"
2023-03-31 19:51:46 -07:00
YuraIz
7d79933d28
integrated-title-bar: Ignore style config on macos and windows 2023-03-31 19:45:28 -07:00
YuraIz
2333046e1b
integrated-title-bar: Add button placement option 2023-03-31 19:45:26 -07:00
YuraIz
0401dc26d6
integrated-title-bar: Add libadwaita styled buttons 2023-03-31 19:44:20 -07:00
YuraIz
29fe4709ce
integrated-title-bar: Add color configuration 2023-03-31 19:44:19 -07:00
YuraIz
36f41af81e
integrated-title-bar: Add window buttons to the tabbar 2023-03-31 19:44:13 -07:00
Wez Furlong
74da631430
mux: allow client to provide palette to mux server
The server-side ownership of the palette is a stumbling block for
many users, so let's fix it.

This commit allows the client to pass its configured palette to
the server when it connects, and when the config is changed.

That palette takes precedence over the palette from the server config.

However, if the remote application uses any escape sequences that
redefine the color palette, the color palette that was active at
that point in time is forked and use as the basis, and will remain
the active palette until the palette is reset via escape sequences.

refs: https://github.com/wez/wezterm/issues/2686
refs: https://github.com/wez/wezterm/issues/3397
2023-03-31 08:02:32 -07:00
Wez Furlong
d1c2257bd8
macos: fix CTRL key behavior when use_ime=true
refs: https://github.com/wez/wezterm/pull/2435
refs: https://github.com/wez/wezterm/issues/2771
refs: https://github.com/wez/wezterm/issues/2630
2023-03-30 21:49:48 -07:00
Wez Furlong
1e688a5128
Add serial_ports config
This commit teaches the config about SerialDomains, and the mux
layer about constructing a SerialDomain, then changes the GUI
layer to use those pieces to set up `wezterm serial`.

A new `serial_ports` config is added, and the GUI layer knows how
to apply it to the set of domains in the mux.

The result of this is that you can now define a domain for each
serial port and spawn a serial connection into a new tab or window
in your running wezterm gui instance.
2023-03-29 19:05:13 -07:00
Wez Furlong
a5b52de02c
populate ssh domains from your ssh config by default
If you haven't assigned `config.ssh_domains` to something else,
this commit will populate it from the hosts it finds in your
ssh config file.

First it will emit no-multiplexing entries that allow ad-hoc
ssh connections.

Then it will emit wezterm multiplexing enabled versions of those
entries.
2023-03-29 11:51:59 -07:00
Wez Furlong
2bc4cb4a0e
add more context to errors
refs: https://github.com/wez/wezterm/issues/3390
2023-03-28 16:35:07 -07:00
Wez Furlong
ce4b054264
config: add more context on some errors
refs: #3390
2023-03-28 09:13:25 -07:00
Wez Furlong
05919acb29
RLIMIT_NPROC is not a macos thing 2023-03-28 08:08:02 -07:00
Wez Furlong
a7fde7935b
raise ulimit nofile and nproc to a reasonable min value on unix systems
It's a tremendous PITA for the user to do this at the system level on a
mac, where it is sorely needed.  This commit allows raising to a desired
minimum level, but won't decrease from an already larger soft limit.

refs: https://github.com/wez/wezterm/discussions/3353
2023-03-28 07:29:47 -07:00
Wez Furlong
ca283c1310
palette: prioritize platform-appropriate shortcuts
On macOS prefer CMD, but on other platform prioritize shortcuts
that don't use CMD, as those tend to reserve the CMD based shortcuts
for the system.

Allow specifying how many shortcuts to show if an action has
multiple assignments.  The default is 1.

refs: https://github.com/wez/wezterm/issues/3335
2023-03-25 11:14:54 -07:00
Wez Furlong
c5213b4f85
palette: add config for how ui key caps render
added a new `ui_key_cap_rendering` option that accepts the following
values:

```lua
-- Super, Meta, Ctrl, Shift
config.ui_key_cap_rendering = 'UnixLong'

-- Super, M, C, S
config.ui_key_cap_rendering = 'Emacs'

-- Apple macOS style symbols
config.ui_key_cap_rendering = 'AppleSymbols'

-- Win, Alt, Ctrl, Shift
config.ui_key_cap_rendering = 'WindowsLong'

-- Like WindowsLong, but using a logo for the Win key
config.ui_key_cap_rendering = 'WindowsSymbols'
```

refs: https://github.com/wez/wezterm/issues/3335
2023-03-25 09:18:52 -07:00
Wez Furlong
499e5f73d0
palette: show the label from the command in the palette
Given an assignment like this:

```
{
  key = "b",
  mods = "ALT",
  action = wezterm.action.SplitPane {
    direction = 'Right',
    command = {
      label = 'Bash Right',
      args = {'/usr/bin/bash' }
    }
  }
}
```

we should show the label from the command in the palette.
That's what this commit enables.

If there is no label, but the arguments are set, then the
arguments will be shown instead.

refs: #3252
2023-03-24 21:05:14 -07:00
Gkirito
63676c30d2
refactor(config & macos/windows): rename window_background_blur to macos_window_background_blur 2023-03-24 19:04:15 -07:00
Gkirito
1b24ff1abf
feat(config & window): use CGSSetWindowBackgroundBlurRadius to set background blur on macos 2023-03-24 19:04:15 -07:00
eaglgenes101
4ee16328b8 Changed config option name to mouse_wheel_scrolls_tabs, made it default to true (matching current behavior) 2023-03-21 22:09:14 -07:00
eaglgenes101
19cf64edcf Cargo formatted 2023-03-21 22:09:14 -07:00
eaglgenes101
8308887d21 Add config option for scrolling the tab bar 2023-03-21 22:09:14 -07:00
Wez Furlong
dd8d4a04f4
sync from https://github.com/folke/tokyonight.nvim
Pull in the enhanced scheme that includes wezterm metadata and colors.

Co-authored-by: Thomas Croft <103956335+thomascft@users.noreply.github.com>

closes: https://github.com/wez/wezterm/pull/3208
2023-03-20 12:42:09 -07:00
Wez Furlong
775bad32e1
sync color schemes 2023-03-20 12:25:44 -07:00
Wez Furlong
eff64feb1b
sync-color-schemes: handle renamed schemes slightly better
We no longer completely forget about the old incarnation,
and we now rename all historical aliases and allow their
use.
2023-03-20 12:24:00 -07:00
Jalil David Salamé Messina
d541e2e13d fix(clippy): Remove closures where possible
- Removes closures and function calls for types that implement default:

  ```rust
  // Change
  let _my_str = get_str().unwrap_or(String::new);
  // To
  let _my_str = get_str().unwrap_or_default();
  ```

- Uses the `.cloned()/.copied()` methods where possible
- Use function pointer instead of simple closure

May improve performace, as closures generate more code, and this might
unlock some inlining opportunities.
2023-03-19 08:41:38 -07:00
Jalil David Salamé Messina
191aacc7d7 fix(clippy): Use faster methods on Iterators
- Use `find` instead of `position(..).next()`
- Use `any` instead of `position(..).next().is_some()/.is_none()`
- Use `first/next` instead of `get(0)/nth(0)`
- Prefer `for` loops over `while let` loops on iterators

May improve performance.
2023-03-19 07:29:23 -07:00
Wez Furlong
8e0f9947d2
fix time.call_after when used inside an event callback
```lua
local wezterm = require 'wezterm'

function user_callback_test(window, pane)
  print("user_callback_test()")
  wezterm.time.call_after(3, function()
    print("Hello again, later")
  end)
end

return {
  keys = {
    { mods = 'CTRL|ALT',
      key = 'u',
      action = wezterm.action_callback(user_callback_test)
    }
  }
}
```

refs: https://github.com/wez/wezterm/issues/3026
2023-03-19 07:22:14 -07:00
Wez Furlong
6a9dfc409d
improve default hyperlink_rules. add default_hyperlink_rules()
refs: https://github.com/wez/wezterm/issues/928
2023-03-16 20:44:15 -07:00
Jalil David Salamé Messina
cb9dc3a800 fix(clippy): Remove unnecessary clone/to_string calls 2023-03-16 07:40:12 -07:00
Jared Baur
2408367e6f Improve XDG configuration searching
In addition to XDG_CONFIG_HOME, use XDG_CONFIG_DIRS
(https://specifications.freedesktop.org/basedir-spec/basedir-spec-latest.html)
to append paths for searching for configuration files.
2023-03-15 23:11:02 -07:00
Wez Furlong
5e5f816f83
add log_unknown_escape_sequences config option 2023-03-15 22:47:32 -07:00
Jalil David Salamé Messina
c6dc38b7f3 fix(clippy): Derive Default where possible 2023-03-15 10:21:11 -07:00
Wez Furlong
b021551080
maybe fix win32 build 2023-02-11 10:07:31 -07:00
Wez Furlong
797d3819b7
wsl: default_cwd is now ~
This matches up better to most peoples expectations

refs: https://github.com/wez/wezterm/issues/2826
2023-02-11 08:21:18 -07:00
Wez Furlong
66ec3f6eb6
make command palette font a little larger
refs: https://github.com/wez/wezterm/issues/1485
2023-02-10 15:24:45 -07:00
Wez Furlong
69fce071ea
config: allow config_builder to work with set_config_overrides
refs: https://github.com/wez/wezterm/issues/3079
2023-02-08 21:24:26 -07:00