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

329 Commits

Author SHA1 Message Date
Wez Furlong
6c1710f87d mux: remove ProgDomain; just pass down default prog/cwd as appropriate
This allows making these values configurable per-domain in the
future.

refs: #1456
2021-12-24 07:52:02 -07:00
Wez Furlong
bd6072b320 avoid default_prog, default_cwd when spawning panes via ssh
refs: https://github.com/wez/wezterm/issues/1456
2021-12-23 23:24:42 -07:00
Wez Furlong
225d15c9aa ActivatePaneDirection now supports Next and Prev
This allows cycling through all the panes in a tab

refs: #976
2021-12-23 21:00:26 -07:00
Wez Furlong
1d064e0913 Add get_foreground_process_name, expose it and cwd in PaneInformation
Add `get_foreground_process_name` to both Pane and the lua wrapper.

Add `foreground_process_name` and `current_working_dir` fields to
`PaneInformation`.  In order for those to be dynamically fetched,
switch the lua conversion for `PaneInformation` to be a UserData
with field access methods.  It's a little more verbose but allows
us to lazily compute these two new fields.

refs: https://github.com/wez/wezterm/discussions/1421
refs: https://github.com/wez/wezterm/issues/915
refs: https://github.com/wez/wezterm/issues/876
2021-12-23 18:49:17 -07:00
Wez Furlong
38087755e1 quickselect: allow changing label for custom actions 2021-12-23 16:32:20 -07:00
Wez Furlong
d25580d10f cargo fmt 2021-12-23 12:35:20 -07:00
Wez Furlong
0e6c75c026 allow left-button-release to copy to selection when shift is held
This is really a timing issue: if shift-click extension of the mouse
selection is used, the user may release the mouse button slightly
after the SHIFT key (which is fine) or vice versa (which was not
previously matched)

refs: #1204
2021-12-23 12:33:51 -07:00
Wez Furlong
668d41ad5d quickselect: add QuickSelectArgs and helpers for opening urls
This commit expands quick select mode so that you can trigger it
with distinct sets of patterns (eg: urls on one key assignment,
hashes on a different key assignment), different alphabets,
and lastly, the option to perform a different action from
the default copy action.

You can pair this with `action_callback` to run lua code to
do something with the selected text.

This commit also adds `wezterm.open_with`, a helper function
for opening documents/URLs.

refs: #846
refs: #1362
2021-12-23 10:55:44 -07:00
Wez Furlong
6a265d9f72 new ActivateTabRelativeNoWrap key assignment
refs: #1414
2021-12-23 09:32:49 -07:00
Wez Furlong
5c222cfcdc term: allow iterm2 file transfer protocol
Adds some plumbing to allow the GUI to implement a download handler
and connect that up for iterm2 image/file transfers that have their
inline property set to false.

Previously we'd just log an error.

Now we will by default download the file to the user's download
directory.

This behavior can be turned off via the new `allow_download_protocols`
configuration setting.

File transfers can be initiated on a remote host via the
https://iterm2.com/utilities/it2dl script.

When the download completes, a toast notification is shown that will
open the file when clicked.

refs: https://github.com/wez/wezterm/discussions/1450
2021-12-22 09:21:39 -07:00
Wez Furlong
008b7f3796 config: skip UTF-8 BOM in primary config file
This is a semi-effective band-aid, as it won't change lua's own
lack of BOM support when importing files via `require`.

refs: #1452
2021-12-22 07:34:34 -07:00
Wez Furlong
dd150131b7 fonts: allow setting harfbuzz and freetype options per-font
`wezterm.font` and `wezterm.font_with_fallback` can now specify
harfbuzz_features and freetype load/render target and flags as
options on a per-font basis.

This allows you to do things such as adjust shaping (eg: ligatures) or
rendering (eg: disable bitmaps, or adjust hinting) for a single font in
a fallback rather than globally for all fonts.
2021-12-20 21:56:59 -07:00
Wez Furlong
4358e718c3 fix doc comment
refs: #1406
refs: #986
2021-12-15 20:20:25 -07:00
Wez Furlong
5500bd64e4 kitty: default to enabling kitty support
refs: https://github.com/wez/wezterm/issues/1406
refs: https://github.com/wez/wezterm/issues/986
2021-12-15 17:59:08 -07:00
Wez Furlong
20e424f54b add default_gui_startup_args config
closes: https://github.com/wez/wezterm/issues/1030
2021-12-11 23:18:22 -07:00
Wez Furlong
e352c40905 ssh domains now support ssh_config overrides
closes: https://github.com/wez/wezterm/issues/1149
2021-12-11 22:30:54 -07:00
Wez Furlong
66908eabb4 add ScrollToTop and ScrollToBottom key assignments
refs: https://github.com/wez/wezterm/issues/1360
2021-12-11 22:02:31 -07:00
Wez Furlong
1ce261f7a9 mux: add proxy_command to unix_domains
Potentially enables using the mux with WSL 2 on Windows,
although this commit was authored and tested on a mac.
2021-12-11 17:29:37 -07:00
Wez Furlong
bde2c728bf ci: use consistent git core.abbrev setting for TAGNAME
refs: https://github.com/wez/wezterm/issues/1365
2021-12-05 19:21:06 -07:00
Wez Furlong
955b37ff64 mux server: redirect stdout,stderr to log file on Windows
This got lost somewhere along the way.

Importantly, we need to explicitly set the pty to use invalid stdio
handles for the spawned child in order to avoid a weird situation
where eg: cmd or powershell would end up writing to the log file
despite it being spawned into its own PTY.

refs: #1358
2021-12-05 10:11:43 -08:00
Wez Furlong
cabcfb70f9 mux: prefer to use wezterm relative to current exe
I think this will help with some PATH related issues, such as
refs: https://github.com/wez/wezterm/issues/1359
2021-12-02 21:52:17 -07:00
Wez Furlong
b71e1ad618 Revise appimage env comment 2021-12-02 21:21:29 -07:00
Srevin Saju
37c3403241 fix: do not propagate $APPIMAGE and $APPDIR env vars to child processes 2021-12-02 21:21:29 -07:00
Wez Furlong
225e7a1243 introduce unicode_version config
This is a fairly far-reaching commit. The idea is:

* Introduce a unicode_version config that specifies the default level
  of unicode conformance for each newly created Terminal (each Pane)
* The unicode_version is passed down to the `grapheme_column_width`
  function which interprets the width based on the version
* `Cell` records the width so that later calculations don't need to
  know the unicode version

In a subsequent diff, I will introduce an escape sequence that allows
setting/pushing/popping the unicode version so that it can be overridden
via eg: a shell alias prior to launching an application that uses a
different version of unicode from the default.

This approach allows output from multiple applications with differing
understanding of unicode to coexist on the same screen a little more
sanely.

Note that the default `unicode_version` is set to 9, which means that
emoji presentation selectors are now by-default ignored.  This was
selected to better match the level of support in widely deployed
applications.

I expect to raise that default version in the future.

Also worth noting: there are a number of callers of
`unicode_column_width` in things like overlays and lua helper functions
that pass `None` for the unicode version: these will assume the latest
known-to-wezterm/termwiz version of unicode to be desired. If those
overlays do things with emoji presentation selectors, then there may be
some alignment artifacts. That can be tackled in a follow up commit.

refs: #1231
refs: #997
2021-11-25 09:00:45 -07:00
Jonathan
e9ed2b4d3e
Unzoom when switching panes (#1301)
* mux: unzoom when switching panes

Add `unzoom_on_switch_pane` config option:

When switching to another pane with ActivatePaneDirection, if the
current pane is zoomed, unzoom and then switch instead of doing nothing.

* Apply suggestions from code review

Co-authored-by: Wez Furlong <wez@wezfurlong.org>
2021-11-13 11:43:15 -08:00
Wez Furlong
4225610c09 add config option to enable resize increments, disable by default
refs: #1254
refs: #1289
2021-11-09 08:30:58 -07:00
Wez Furlong
04768fd1e2 Speculative fix for wonky vertical alignment
The issue seems to correlate with fractional pixels produced
by 0.5cell padding, so let's round down to avoid the fraction.

refs: https://github.com/wez/wezterm/issues/1228
2021-10-21 18:56:11 -07:00
Wez Furlong
c1a766404c config: add ssh_backend config, and default to libssh
refs: #1014
2021-10-21 07:16:42 -07:00
Wez Furlong
24875004f6 add canonicalize_pasted_newlines config option
refs: #1213
2021-10-17 13:14:16 -07:00
Wez Furlong
3b12aa1038 mux: mux_env_remove config to control which env var are removed
closes: #1225
2021-10-17 12:46:16 -07:00
Wez Furlong
32d18905cc Add wezterm.background_child_process 2021-10-17 10:37:47 -07:00
Wez Furlong
7e59916c5c fixup title font selection on linux
Was mistakenly trying to use the windows font because of negative logic.
Tidy up, and prefer the gnome default theme font (Cantarell), but fall
back to DejaVu Sans.
2021-10-09 08:12:26 -07:00
Wez Furlong
854ea8f2d1 change default window padding
This makes the default terminal config look a little nicer.
2021-10-08 20:38:28 -07:00
Wez Furlong
5d765e2efe config: adjust default title bar font
Make it a little large, bold, and pick a better approximation of the macOS
titlebar font on macOS.
2021-10-08 19:30:40 -07:00
Wez Furlong
8c3477006f Allow using unit like "1cell" or "5%" for window_padding
This commit introduces the `Dimension` type which allows specifying
a value in a variety of units; pixels, points, cells, percent.

`Dimension` needs contextual information to be evaluated as pixel
values, which makes resolving the value from the config slightly
more of a chore.

However, this type allows more flexible configurations that scale
with the font size and display dpi.

refs: #1124, #291, #195
2021-10-07 19:26:22 -07:00
Wez Furlong
49d77138ae gui: refine text positioning math around fancy tab bar
Avoid accidentally scaling the tab bar when using IncreaseFontSize.

Use a "better" default title font based on the platform.

Avoid a gap between bottom of tab button and dividing line at
certain font sizes.
2021-10-04 23:13:21 -07:00
Wez Furlong
962e44bbfb WIP: fancier tab bar
`use_fancy_tab_bar` switches to an alternate rendering of the tab
bar that uses the window_frame config to get a proportional
title font to use to render tabs, as well as rendering a few
additional elements to space out and make the tabs feel more
like tabs.

Computing the number of tabs doesn't respect the alternate font
at this time.

Formatted tab item foreground and background colors are also
not respected at this time.

refs: #1180
2021-10-04 17:35:54 -07:00
Wez Furlong
ca89181098 bell: allow changing the cursor color when the bell is rung
I find this less distracting than both the audible and the default
background color flashing.
2021-09-29 08:02:34 -07:00
Wez Furlong
72cb110b65 add audible_bell config option
This allows using the system beep sound, currently only on macos.

refs: #3
2021-09-26 12:55:19 -07:00
Benoit de Chezelles
317772fe8f lua: Add wezterm.action_callback to help define key callbacks 2021-09-25 15:42:08 -07:00
Wez Furlong
0c1ad718d0 add visual bell
refs: #3
2021-09-25 12:40:22 -07:00
Frieder Bluemle
3f4ea691af Add additional tab activation key assignments 2021-09-12 09:52:11 -07:00
Wez Furlong
93e18b2a01 deps: colorgrad -> 0.5 2021-09-05 23:27:01 -07:00
Wez Furlong
4c8ccf8efc Add Multiple key assignment
refs: https://github.com/wez/wezterm/pull/1091
2021-09-04 13:01:34 -07:00
Wez Furlong
bc4ed3735d Add SendKey key assignment
refs: https://github.com/wez/wezterm/pull/1091
2021-09-03 12:07:17 -07:00
Wez Furlong
b53a6059de increase max fps to 60 by default, improve coalesce
* Trigger a paint immediately from invalidate if not throttled
* Otherwise defer the other events until we're about to sleep for xcb
  events, which should maximize the coalesce around resize/expose events

refs: #1051
2021-09-02 08:53:03 -07:00
Jonas Belouadi
703f2c4d67 Remove explicit deref in 256-colors loop. 2021-08-23 16:32:43 -07:00
Jonas Belouadi
4565fc4ebd Deserialize indexed keys into 'u8' instead of 'String'. 2021-08-23 16:32:43 -07:00
Jonas Belouadi
46ea5d73e7 Format code with cargo fmt. 2021-08-23 16:32:43 -07:00
Jonas Belouadi
4b3853fb0f Add support for setting arbitrary colors ranging from 16 to 256. 2021-08-23 16:32:43 -07:00
Wez Furlong
c6e1889b04 remove unused alt alpha blending config
This doesn't make sense in a dual source blending world
2021-08-19 09:41:48 -07:00
Wez Furlong
571c137955 gui: gamma fixup
This makes the comparison in https://github.com/wez/wezterm/issues/544
work for me on mac, linux (x11, wayland) and also on Windows but
only using WGL.

It looks like we can use the proper colorspace on all targets
except for ANGLE EGL.  For whatever reason, the combination of
glium and ANGLE EGL on windows over-gamma corrects.

AFAICT, the framebuffer and perhaps the surfaces it creates
don't indicate srgb support, and whatever combination of status
they return tickles glium's srgb stuff the wrong way.

I think the "solution" is just to directly use WGL by default.

EGL was on by default because it tended to be more survivable
when graphics card drivers were updated, but the last couple
of times I updated mine it still killed wezterm anyway.

refs: #544
2021-08-19 09:17:09 -07:00
Wez Furlong
ab21910d80 deps: update bitflags -> 1.3 2021-08-15 18:21:17 -07:00
Wez Furlong
ab6c4777cb config: add wezterm.gradient_colors 2021-08-13 23:52:32 -07:00
Wez Furlong
e234ea7933 gradients: add presets 2021-08-13 22:41:31 -07:00
Wez Furlong
615b5b3966 gui: support radial gradients 2021-08-13 17:38:33 -07:00
Wez Furlong
d9e0340a94 gui: add some randomness to gradients to avoid banding 2021-08-13 13:35:55 -07:00
Wez Furlong
cbfb6d59c5 added new window_background_gradient config option 2021-08-12 23:08:38 -07:00
Wez Furlong
6f78ee4f14 deps: update unicode-segmentation to 1.8 2021-08-11 23:06:17 -07:00
Wez Furlong
3370466dc4 config: adjust default mux_output_parser_buffer_size
This size seems to be ~sweet spot for `time cat bigfile`, cutting the
time in half from the prior value.  Making the buffer smaller doesn't
improve things, nor does making it bigger; this is balancing the latency
of applying the update to the model with the back-pressured parsing
latency.
2021-08-11 23:06:16 -07:00
Wez Furlong
8cc90dcf33 tidy up add_to_config_reload_watch_list
refs: #989
2021-08-10 20:38:41 -07:00
AusCyberman
e8e40c9704
Added watch_path (#989) 2021-08-10 20:30:43 -07:00
Wez Furlong
2b6ba0dfcc increase default mux_output_parser_buffer_size
refs: #999
2021-08-08 16:41:14 -07:00
Wez Furlong
17fc41fc52 add option to select alternative alpha blending
I'm not sure if this is needed now that we have a single draw call, but
based on the history and the nuance of different gl/driver/os quirks it
feels like a good idea to keep this option in the back pocket.
2021-08-04 15:26:48 -07:00
Wez Furlong
fb9338f0e7 default disable kitty graphics until support is improved
You can run `wezterm --config enable_kitty_graphics=true` to do ad-hoc
tests with the protocol enabled.

refs: #986
refs: #1998
2021-07-31 10:23:44 -07:00
Wez Furlong
159abe5e28 mux: make action parser buffer size configurable and smaller
Previously, we'd use a 1MB buffer both to read the output from the
associated pty (blocking), and the same size buffer again to do the
non-blocking read on top of that.

For pathological cases (eg: cat 100MB+ files), we could build a
resulting `Vec<Action>` with over 1mm entries and it could take as much
as 100ms to apply those actions to the terminal model.

This meant that the output could stutter/lag and appear to be processed
more slowly.

This commit introduces a configuration value for the buffer size for the
second stage, and makes it 10KB in size.  This helps to constrain the
size of the Action vec and keeps the incremental processing costs down,
while still managing the same throughput.
2021-07-31 08:57:13 -07:00
Autumn Lamonte
ce9d166733 #133 ENQ response 2021-07-24 23:36:20 -07:00
Autumn Lamonte
d8cacee28a #133 blinking text 50% 2021-07-24 23:29:31 -07:00
Wez Furlong
d592696ca7 config: capture the value of WSLENV, rather than its name
Doh!
2021-07-22 07:14:03 -07:00
Cédric Schieli
77261ac374 Allow styling of the whole new tab button 2021-07-18 19:11:12 -07:00
Wez Furlong
91b3c64568 config: update WSLENV to hold TERM related environment
refs: #230
refs: #936
2021-07-18 17:49:41 -07:00
Wez Furlong
1f5b900f3d plumb appearance change event -> reload on macos
This commit causes a window-config-reloaded event to trigger
when the appearance (dark/light mode) is changed on macos.

It also arranges to propagate the window level config to newly
spawned panes and tabs, created both via the gui and via the
CLI/mux interface.

refs: https://github.com/wez/wezterm/issues/894
refs: https://github.com/wez/wezterm/issues/806
2021-07-18 00:01:53 -07:00
Wez Furlong
75eaaab6a1 Allow window config overrides to apply per-pane
This allows window-level config overrides to apply
to panes contained within the window.

For instance, this allows setting a window-level
color scheme.
2021-07-17 23:02:41 -07:00
Wez Furlong
ac5199c216 config: add bypass_mouse_reporting_modifiers option
This allows changing eg: SHIFT to ALT for bypassing mouse reporting.

refs: https://github.com/wez/wezterm/issues/911
2021-07-11 22:02:23 -07:00
Wez Furlong
db6da81272 window: move away from async event queue
I added this originally thinking that it would make it easier to resolve
https://github.com/wez/wezterm/issues/695 and to integrate wgpu support,
but it's the cause of https://github.com/wez/wezterm/issues/922 so let's
take it out and more directly connect the window events to those in the
terminal.

This commit likely breaks mac and windows; pushing it so that I can
check it out and verify on those systems.
2021-07-10 17:30:19 -07:00
Wez Furlong
9c77d56026 RgbColor: hide internal red, green, blue fields
I'd like to adjust this to support 10bpc color, so the first step
is hiding the individual 8bpc fields.
2021-07-10 14:22:31 -07:00
Wez Furlong
423b208780 font weight can now be specified as the underlying opentype weight
opentype allows a font to have a weight in the range 0-1000.
MacOS has its own concept of symbolic weight names and opentype
values that is a slightly different scale of boldness to Windows
and Linux.

That means that Medium could be a different range of opentype
weight values depending on the system.

To further complicate things, the font designer can name their
variant with any name they like and assign it an arbitrary
opentype weight value.

For the Operator Mono font, it has Book variant with opentype
weight 325 and a Light variant with an opentype weight of 300.

wezterm was considering these both to have `FontWeight::Light` because
that's how those values were bucketed, which results in amibiguity in
resolve the font and frustration in not being able to access one of the
variants.

This commit changes the `FontWeight` type to now hold the unambiguous
opentype weight value, and to define some symbolic aliases for
some specified weights.

When serializing, if the weight matches a symbolic alias, then that
name will be used in the canonical name (eg: as listed via ls-fonts).
Otherwise, the numeric value will be used.

When parsing the font configuration, wezterm will allow both symbolic
and numeric values.

This allows all of the Operator Mono variants to be referenced
unambiguously, although some variants have to be specified via the
numeric weight:

```
wezterm.font("Operator Mono", {weight=275, stretch="Normal", italic=false}) -- /Users/wez/.fonts/OperatorMono-XLight.otf, FontDirs
wezterm.font("Operator Mono", {weight="Light", stretch="Normal", italic=false}) -- /Users/wez/.fonts/OperatorMono-Light.otf, FontDirs
wezterm.font("Operator Mono", {weight=325, stretch="Normal", italic=false}) -- /Users/wez/.fonts/OperatorMono-Book.otf, FontDirs
wezterm.font("Operator Mono", {weight="DemiLight", stretch="Normal", italic=false}) -- /Users/wez/.fonts/OperatorMono-Medium.otf, FontDirs
wezterm.font("Operator Mono", {weight="Regular", stretch="Normal", italic=false}) -- /Users/wez/.fonts/OperatorMono-Bold.otf, FontDirs
```

https://github.com/wez/wezterm/issues/849#issuecomment-873454483
2021-07-04 08:55:08 -07:00
Wez Furlong
c514254138 wayland: use proportional font for title bar
allow specifying the font in the config file
2021-06-27 13:04:20 -07:00
Wez Furlong
ca8209b230 wayland: move frame color config to the config file
This simplifies it a bit and exposes the config via the config file;
the following options are possible, each one specifies a color

```lua
return {
  window_frame = {
    inactive_titlebar_bg = "",
    active_titlebar_bg = "",
    inactive_titlebar_fg = "",
    active_titlebar_fg = "",
    inactive_titlebar_border_bottom = "",
    active_titlebar_border_bottom = "",
    button_fg = "",
    button_bg = "",
    button_hover_fg = "",
    button_hover_bg = "",
  }
}
```

refs: https://github.com/wez/wezterm/issues/761
2021-06-27 12:33:56 -07:00
Wez Furlong
f752d0e7ac set COLORTERM=truecolor in the environment
closes: https://github.com/wez/wezterm/issues/875
2021-06-15 19:34:31 -07:00
Wez Furlong
3ea030794b memoize the renderer used for termwiztermtab and custom tab bars
Create only one, then just clone as needed.

refs: #817
2021-06-13 09:06:29 -07:00
Wez Furlong
cc19aaca9f revise skip_close_confirmation_for_processes_named for Windows
closes: #843
2021-06-10 07:39:00 -07:00
Wez Furlong
cb4da18021 key assignment and docs for ShowDebugOverlay
refs: https://github.com/wez/wezterm/issues/641
2021-05-30 19:56:11 -07:00
Wez Furlong
e29fdae3b9 dead code: remove old FontHinting, FontAntialiasing bits 2021-05-22 15:04:42 -07:00
Wez Furlong
9b082edb8d log errors when a color scheme fails to load
refs: https://github.com/wez/wezterm/issues/794
2021-05-15 13:39:31 -07:00
Wez Furlong
58157c47a9 config: can now subscribe to config change events
This removes a couple of periodic config polls

refs: https://github.com/wez/wezterm/issues/770
2021-05-08 11:06:07 -07:00
Chris
2add312c5c
Allow VoidSymbol keycode to be seen by wezterm (#759)
* allow voidsymbol for key code

* update docs, cleanup

* cleanup and fmt of files

* remove unnecessary inputs
2021-05-07 07:54:24 -07:00
Wez Furlong
0e9d86f9f9 lua: print -> log_info
Make print equivalent to log_info.
Improve the various log functions so that all of their arguments
are considered.

refs: https://github.com/wez/wezterm/issues/641
2021-05-03 09:19:52 -07:00
Wez Furlong
09f0421b48 add lua repl to the debug overlay
`wezterm` is pre-imported.
The repl prints the result of the expressions to the overlay.

refs: https://github.com/wez/wezterm/issues/641
2021-05-03 09:19:44 -07:00
Wez Furlong
8b71a57513 add debug overlay
Adds a `ShowDebugOverlay` key assignment that will create a tab
overlay that shows a limited number of recently logged events.

refs: https://github.com/wez/wezterm/issues/641
2021-05-03 09:19:38 -07:00
Wez Furlong
b5f6a79520 add nushell to list of shells 2021-05-01 19:50:31 -07:00
Wez Furlong
82d825ab37 split padding out from truncation
This makes these functions a bit more composable!

Heads up @jankatins; this is a breaking change (for the better!)

refs: https://github.com/wez/wezterm/issues/647
2021-05-01 18:26:53 -07:00
Wez Furlong
8880979586 Adjust font scaling math again
This commit introduces the knowledge about whether a font is
scalable or was using bitmap strikes (eg: color emoji bitmaps).

Then that information is used to help figure out whether and
how to scale a glyph.

refs: https://github.com/wez/wezterm/issues/685
2021-05-01 16:45:57 -07:00
Wez Furlong
9ccdc157a7 fonts: search locator for fallbacks first
Also add an option to control whether we look in font_dirs for fallback.
Previously we would, but it could lead to some surprising fallback
choices.

The default now is to search locator then built-in.

refs: https://github.com/wez/wezterm/issues/685
refs: https://github.com/wez/wezterm/issues/727
2021-05-01 16:45:57 -07:00
Wez Furlong
35eb7383b1 ci: simplify version number
Previously, we used `git describe --tags` to produce a version number
for non-released builds derived from the most recent tag + some info
such as the number of commits since that tag and then `g{HASH}`.

That always confuses people because the date portion at the front
looks old (it is typically the previous release) and the hash at
the end has that `g` in it.

This commit simplifies both the tag name used when making a release
and the computed version number take the date/time from the current
commit, and then append the hash.  That way the version number always
corresponds to a commit.

This scheme doesn't help detect situations where the commit is
dirty, but I don't think the old one would have helped with that
either.
2021-04-29 20:23:47 -07:00
Wez Furlong
c4dc358282 add truncate_left_to_width
refs: #647
2021-04-27 06:23:19 -07:00
Wez Furlong
7e996950f6 add wezterm.truncate_to_width
refs: https://github.com/wez/wezterm/issues/647
2021-04-26 22:27:12 -07:00
Wez Furlong
be9c60bfc8 removed tab_bar_style options in favor of format-tab-title
refs: https://github.com/wez/wezterm/issues/647
2021-04-26 20:16:47 -07:00
Wez Furlong
0f2f3734d9 add wezterm.column_width
refs: https://github.com/wez/wezterm/issues/647
2021-04-26 20:10:27 -07:00
Wez Furlong
3028756ccb add tab_bar_at_bottom config option
closes: https://github.com/wez/wezterm/issues/278
2021-04-25 20:49:48 -07:00
Wez Furlong
8ce376753f round out quick select mode
* Make alphabet and patterns configurable
* add docs
* Enhance scrollback search to support regex captures so that
  searching for eg: `fo(o)` will select the last `o` in `foo`.

refs: https://github.com/wez/wezterm/issues/732
2021-04-25 16:27:39 -07:00
Wez Furlong
5b1631fe21 add quickselect overlay
This is the first pass implementation, drawing on the alphabet logic
and default patterns from tmux-thumbs (thanks @fcsonline!).

ctrl-shift-space pops up the quick select overlay.
Typing the highlighted prefix will select the matching text and
copy it as though the `Copy` key assignment was used.

TODOs are to make the alphabet and patterns configurable, as well
as write up some docs.

refs: #732
2021-04-25 11:52:14 -07:00
Wez Furlong
053cb11e9f improve ssh domain support for ssh_config
This tidies up how we pass the ssh config to the connection ui
logic, by moving the ssh_config setup to the two callers.

A couple of notable adjustments:

* SshDomain::username is now optional; it will default to the
  values computed by the ssh config file loader
* no_agent_auth value wasn't hooked up to anything, but now it is

refs: https://github.com/wez/wezterm/issues/730
2021-04-24 21:56:32 -07:00
Wez Furlong
2c89e47f9e add force_reverse_video_cursor option
refs: https://github.com/wez/wezterm/issues/706
2021-04-24 21:16:58 -07:00
Wez Furlong
e3fcdc9f36 add format-window-title event
This provides a flexible way for users to customize what gets
shown in the window title bar.

closes: https://github.com/wez/wezterm/pull/603
2021-04-24 16:47:26 -07:00
Wez Furlong
e83d059fc7 couple of build tweaks for git versioning and macos build perf 2021-04-23 23:29:43 -07:00
Wez Furlong
d705886b53 Add pane_focus_follows_mouse
closes: https://github.com/wez/wezterm/issues/600
2021-04-23 22:17:33 -07:00
Wez Furlong
657ed92d82 add swallow_mouse_click_on_pane_focus option
refs: https://github.com/wez/wezterm/issues/724
2021-04-23 22:17:06 -07:00
Wez Furlong
76353a6240 fix: InputMap reading global config instead of window overrides
refs: #656
2021-04-16 08:59:49 -07:00
Wez Furlong
1b12b0a23d fonts: improve font_rules behavior
We now always append the synthetic rules to the those in the config,
and include rules for generating half-bright font selection.
2021-04-15 09:43:24 -07:00
Wez Furlong
776aedf97e fonts: allow specifying weight/stretch/italic for each fallback font 2021-04-12 22:30:55 -07:00
Wez Furlong
5ced58c37b Allow disabling re-sorting fallback fonts
The system locator may have a reasonable default ordering
in its list of fallbacks.

refs: #685
2021-04-12 08:03:17 -07:00
Wez Furlong
406d1044fa fonts: restore messaging about missing glyphs
Now that all platforms know whether the system fallbacks
covered the requested glyph range, it is reasonable to
restore the configuration error window to advise the user
if they are missing fonts for the text they want to display.

refs: https://github.com/wez/wezterm/issues/671
2021-04-10 21:35:58 -07:00
Wez Furlong
99fc3ee3cd fonts: rename width/FontWidth to stretch/FontStretch
This terminology is consistent with that used in CSS to describe
this same property of the font.
2021-04-09 12:00:18 -07:00
Wez Furlong
4c1de197bd fonts: use ParsedFont rather than FontDataHandle
This can avoid extraneous parses in a few cases.
2021-04-08 17:11:23 -07:00
Wez Furlong
ecc500af05 ssh: don't override the ssh config User value 2021-04-08 16:17:49 -07:00
Wez Furlong
43ea2f192a Allow matching font weight and font width in wezterm.font
refs: https://github.com/wez/wezterm/issues/655
2021-04-08 15:42:53 -07:00
Wez Furlong
a6ebae3be2 refine reduce_first_font_to_family 2021-04-07 23:48:49 -07:00
Wez Furlong
b03300404a Allow specifying distinct load and render targets
refs: https://github.com/wez/wezterm/issues/639
2021-04-07 12:15:03 -07:00
Wez Furlong
d7c7c27203 config: distinguish between fallback and synthesized fonts
refs: #648
2021-04-05 08:59:24 -07:00
Wez Furlong
b63a949df8 config: fix wezterm.config_dir, add wezterm.config_file
refs: https://github.com/wez/wezterm/discussions/635#discussioncomment-567968
2021-04-04 08:53:50 -07:00
Wez Furlong
fe48951e7a macos: fixup SUPER+SHIFT+[ key decoding
One of the default key assignments was registered as `SUPER+SHIFT+{`
which worked on macOS, but on Linux, would never match because the
keypress over there was (correctly) reporting as `SUPER+{`.

I originally thought that the user reported issue was a linux
normalization problem, but in looking deeper, the issue is really
that macos is doing something funky!

On macos we collect the interpreted key event as a string, and also
the interpretation of that event without any modifiers applied.

For letters this means that eg: `ALT-l` reports as `¬` for the
processed string and `l` for the unmodified string.  That's good!

However, for punctuation we get a backwards result: SUPER+SHIFT+[
produces `[` for the processed text and `{` for the unmodified
text!

This commit tries to detect this, using a heuristic that is
potentially bad on non-US layouts: if both the processed and
unmodified strings are punctuation then we bias to the unmodified
version.

With that change, that key press is correctly reported as `SUPER+{`,
and we can fix the key assignment registration to reflect that.

I quickly checked the behavior of pressing that same physical key
combination with a DEU layout active, and it appears that the unmodified
stuff is also flipped there; we get a lower-case version of something
that I think should be uppercase.  This commit doesn't change that
behavior:

```
key_event KeyEvent { key: Char('ü'), modifiers: NONE,
        raw_key: Some(Char('Ü')),
        raw_modifiers: SHIFT | SUPER,
        raw_code: Some(33),
        repeat_count: 1, key_is_down: true }
```

refs: https://github.com/wez/wezterm/issues/601
2021-04-03 06:32:13 -07:00
Wez Furlong
47e62cc243 Avoid confusing error when the font has no bold/italic variant
refs: https://github.com/wez/wezterm/issues/617
2021-04-02 17:59:27 -07:00
Alex Gartrell
ee4b4b598c Add ActivateLastTab command
This replicates `last-window` in tmux. To pull this off, I
deliberately store the last tab whenever I'm activating a new one or
spawning a new one. I had to do this explicitly rather than hooking
set_active, because we end up setting the active tab briefly for some
common operations like moving a tab.
2021-04-02 09:14:59 -07:00
Wez Furlong
64236c6216 clippy 2021-03-26 09:03:28 -07:00
Wez Furlong
2902a76c5c lint: fix some clippy stuff 2021-03-25 10:05:34 -07:00
Wez Furlong
3bec6fb5c0 lint: remove redundant semicolons
Newer versions of Rust emit warnings for these
2021-03-25 09:44:27 -07:00
Wez Furlong
ad4b3b4648 add skip_close_confirmation_for_processes_named option
Currently only respected on linux.

refs: https://github.com/wez/wezterm/issues/562
2021-03-22 12:42:46 -07:00
Wez Furlong
b27e4ce2b2 keys: CMD-Q for QuitApplication is now a default on macos 2021-03-22 11:43:53 -07:00
Wez Furlong
22522dc39e render more symbol/icon/emoji at double width by default
Default `allow_square_glyphs_to_overflow_width="WhenFollowedBySpace"`,
and expand its meaning from mostly square glyphs to glyphs that are
also wider than they are tall.

refs: https://github.com/wez/wezterm/issues/565
2021-03-22 11:36:45 -07:00
Wez Furlong
57f1aa2785 fixup build to not consider termwiz tags as wezterm tags
CI got broken by the termwiz release.  This commit teaches the
various `git describe --tags` calls to filter to the wezterm
tags which all start with the year.  We're match `20*` which should
be good for the next 79 years.

I've removed the vergen dependency as there was no way to teach it
to do the equivalent matching, and it wasn't a terrible burden
to just inline the git describe call anyway.
2021-03-17 21:02:03 -07:00
Wez Furlong
eb4323ee59 add config for customizing the tabs and new tab button
```lua
local wezterm = require 'wezterm';

-- The filled in variant of the < symbol
local SOLID_LEFT_ARROW = utf8.char(0xe0b2)

-- The filled in variant of the > symbol
local SOLID_RIGHT_ARROW = utf8.char(0xe0b0)

return {
  tab_bar_style = {
    active_tab_left = wezterm.format({
      {Background={Color="#0b0022"}},
      {Foreground={Color="#2b2042"}},
      {Text=SOLID_LEFT_ARROW},
    }),
    active_tab_right = wezterm.format({
      {Background={Color="#0b0022"}},
      {Foreground={Color="#2b2042"}},
      {Text=SOLID_RIGHT_ARROW},
    }),
    inactive_tab_left = wezterm.format({
      {Background={Color="#0b0022"}},
      {Foreground={Color="#1b1032"}},
      {Text=SOLID_LEFT_ARROW},
    }),
    inactive_tab_right = wezterm.format({
      {Background={Color="#0b0022"}},
      {Foreground={Color="#1b1032"}},
      {Text=SOLID_RIGHT_ARROW},
    }),
  }
}
```
2021-03-11 21:22:10 -08:00
Wez Furlong
f6c37ae371 increase default font size to 12 points 2021-03-10 19:43:02 -08:00
Wez Furlong
fa9cf66fa2 Add file:// to the default implicit hyperlink rule list
closes: https://github.com/wez/wezterm/issues/525
2021-03-09 07:43:33 -08:00
Benoit de Chezelles
683d8e96e8 windows: Add option to treat left ctrl-alt as altgr
The previous behavior was to always treat ctrl-alt as altgr on Windows,
this has been done to better support altgr through a VNC session,
but this is very unintuitive when you don't need this behavior.

ref: #472
2021-03-07 12:52:03 -08:00
Wez Furlong
8fd515d6fa fix typo in battery state value 2021-03-07 00:22:27 -08:00
Wez Furlong
336f209ede Revert and gate shaping changes
I'm calling it a temporary defeat on the shaping changes;
this commit effectively reverts the series of changes made
to support slicing up ligatures like `->` when the cursor
moves through them.

They've introduced so many issues and I've spent hours
that haven't resulted in a complete solution, so I've
disabled those changes by putting them behind a boolean
option.

I'll revisit them after I've cut the next release.

refs: https://github.com/wez/wezterm/issues/478
2021-03-06 23:49:37 -08:00
Wez Furlong
e992ac7ad0 lua: add wezterm.battery_info() function
Queries the system battery information and returns an array of
battery information.

Each element is a lua table with the following entries:

* state_of_charge: expressed as percents
* vendor: the battery manufacturer
* model: the battery model
* serial: the battery serial number
* time_to_full: how long until the battery is full
* time_to_empty: how long until the battery is empty
* state: "Charging", "Discharging", "Empty", "Full", "Unknown"

I haven't run this on a system with a battery yet, so I'm holding
off from showing an example until I've got a work one.

refs: https://github.com/wez/wezterm/issues/500
2021-03-06 14:25:36 -08:00
Wez Furlong
1178639a22 windows: implement decoration setting, change to bitfield
Can now set `window_decorations = "TITLE|RESIZE"` or variations
on those flags.  `NONE` is a shortcut for no flags.
2021-03-04 09:40:38 -08:00
Wez Furlong
945b6b726f windows: allow disabling titlebar, fixup dragging 2021-03-04 08:37:29 -08:00
Wez Furlong
7e1d16e671 Add SUPER+Drag to drag the window 2021-03-03 23:45:02 -08:00
Wez Furlong
4834a29791 macos: support disabling the titlebar
This isn't fully baked yet, so I'm not documenting it yet.
2021-03-03 22:47:31 -08:00
Wez Furlong
9ac230876c Add status_update_interval option for status updates
The status event is triggered at window creation, and
then every `status_update_interval` milliseconds.

refs: https://github.com/wez/wezterm/issues/500
2021-03-02 20:44:08 -08:00
Wez Furlong
ff8bda29e3 lua: add wezterm.strftime
refs: https://github.com/wez/wezterm/issues/500
2021-03-02 09:52:54 -08:00
Wez Furlong
565a4c69d5 lua: add wezterm.format function
The intent is to use this to compose text for a configurable tab bar.

refs: https://github.com/wez/wezterm/issues/500
2021-03-02 09:52:54 -08:00
Wez Furlong
62e14efcb3 lua: add log_info and log_warn 2021-03-02 09:52:54 -08:00
Wez Furlong
1415e9ce4d ci: fixup build on macos where --target is in use 2021-02-28 18:51:09 -08:00
Wez Furlong
d56c5178da shaping: add test for FiraCode
Adds a test and seemingly a fix for https://github.com/wez/wezterm/issues/478#issuecomment-787520977

Fira Code is OFL-1.1 licensed like the other fonts we include,
however, I'm not distributing Fira Code with wezterm.
2021-02-28 13:35:00 -08:00
Wez Furlong
522d4ad814 make exit_behavior = "CloseOnCleanExit" the default
It seems generally useful and non-intrusive, so do that.
2021-02-28 12:01:07 -08:00
Wez Furlong
0597684ebd Render custom block glyphs
As explained in the docs included in this commit, ideally this
wouldn't be needed, but due to a long-standing hinting bug in
freetype <https://gitlab.freedesktop.org/freetype/freetype/-/issues/761>
it seems most expedient to just render our own block glyphs,
so that's what this does!

refs: #433
2021-02-28 09:43:26 -08:00