mirror of
https://github.com/wez/wezterm.git
synced 2024-12-28 07:55:03 +03:00
cli: add --pane-id option to activate-pane-direction
This matches the other subcommands that use this
This commit is contained in:
parent
adcadca480
commit
9d44d6d864
@ -2,10 +2,17 @@ use crate::cli::resolve_pane_id;
|
|||||||
use clap::builder::PossibleValue;
|
use clap::builder::PossibleValue;
|
||||||
use clap::Parser;
|
use clap::Parser;
|
||||||
use config::keyassignment::PaneDirection;
|
use config::keyassignment::PaneDirection;
|
||||||
|
use mux::pane::PaneId;
|
||||||
use wezterm_client::client::Client;
|
use wezterm_client::client::Client;
|
||||||
|
|
||||||
#[derive(Debug, Parser, Clone)]
|
#[derive(Debug, Parser, Clone)]
|
||||||
pub struct ActivatePaneDirection {
|
pub struct ActivatePaneDirection {
|
||||||
|
/// Specify the current pane.
|
||||||
|
/// The default is to use the current pane based on the
|
||||||
|
/// environment variable WEZTERM_PANE.
|
||||||
|
#[arg(long)]
|
||||||
|
pane_id: Option<PaneId>,
|
||||||
|
|
||||||
/// The direction to switch to.
|
/// The direction to switch to.
|
||||||
#[arg(value_parser=PaneDirectionParser{})]
|
#[arg(value_parser=PaneDirectionParser{})]
|
||||||
direction: PaneDirection,
|
direction: PaneDirection,
|
||||||
@ -13,7 +20,7 @@ pub struct ActivatePaneDirection {
|
|||||||
|
|
||||||
impl ActivatePaneDirection {
|
impl ActivatePaneDirection {
|
||||||
pub async fn run(&self, client: Client) -> anyhow::Result<()> {
|
pub async fn run(&self, client: Client) -> anyhow::Result<()> {
|
||||||
let pane_id = resolve_pane_id(&client, None).await?;
|
let pane_id = resolve_pane_id(&client, self.pane_id).await?;
|
||||||
client
|
client
|
||||||
.activate_pane_direction(codec::ActivatePaneDirection {
|
.activate_pane_direction(codec::ActivatePaneDirection {
|
||||||
pane_id,
|
pane_id,
|
||||||
|
Loading…
Reference in New Issue
Block a user