Files
LLeMbas-TTY/config/src/exec_domain.rs
T
Wez Furlong 8f44dc46d9 exec_domains: allow async callbacks. can now also set label for launcher
The fixup callback can now by async, which makes it possible to use
other async functions in the callback.

There is an additional parameter to wezterm.exec_domain that allows
setting the label that is shown in the launcher menu.
It accepts either a string value or an async callback function
that can be used to compute the label dynamically.
2022-07-08 18:46:09 -07:00

18 lines
457 B
Rust

use luahelper::impl_lua_conversion_dynamic;
use wezterm_dynamic::{FromDynamic, ToDynamic, Value};
#[derive(Debug, Clone, FromDynamic, ToDynamic)]
pub enum ValueOrFunc {
Value(Value),
Func(String),
}
impl_lua_conversion_dynamic!(ValueOrFunc);
#[derive(Debug, Clone, FromDynamic, ToDynamic)]
pub struct ExecDomain {
pub name: String,
pub fixup_command: String,
pub label: Option<ValueOrFunc>,
}
impl_lua_conversion_dynamic!(ExecDomain);