expose the tty name associated with a pane

This commit is contained in:
Wez Furlong committed 2023-04-06 17:13:07 -07:00
1 parent 889390a448
commit 0ca050e09d
16 files changed
+126 -1

No files matched your search

+3
View File
@@ -64,6 +64,9 @@ As features stabilize some brief notes about them will accumulate here.
* [wezterm cli rename-workspace](cli/cli/rename-workspace.md). #2787
* [wezterm.mux.rename_workspace](config/lua/wezterm.mux/rename_workspace.md). #2787
* [wezterm cli get-pane-direction](cli/cli/get-pane-direction.md)
* [pane:get_tty_name()](config/lua/pane/get_tty_name.md) and
[PaneInformation.tty_name](config/lua/PaneInformation.md) to reason about the
tty name on local unix systems.
#### Fixed
* mux: Stale remote window mapping could prevent spawning new tabs in remote domain. #2759
+4
View File
@@ -126,3 +126,7 @@ end)
return config
```
{{since('nightly')}}
The `tty_name` field returns the tty name with the same constraints as described
in [pane:get_tty_name()](../pane/get_tty_name.md).
+27
View File
@@ -0,0 +1,27 @@
# `pane:get_tty_name()`
{{since('nightly')}}
Returns the tty device name, or `nil` if the name is unavailable.
* This information is only available for local panes. Multiplexer panes do not report this information. Similarly, if you are using eg: `ssh` to connect to a remote host, you won't be able to access the name of the remote process that is running.
* This information is only available on unix systems. Windows systems do not have an equivalent concept.
This example sets the right status to show the tty name:
```lua
local wezterm = require 'wezterm'
wezterm.on('update-status', function(window, pane)
local tty = pane:get_tty_name()
if tty then
window:set_right_status(tty)
else
window:set_right_status ''
end
end)
return {}
```