aboutsummaryrefslogtreecommitdiffstats
path: root/crates/atuin-pty-proxy/src/lib.rs
blob: d15710794ad94f8071238d703f10c1c20a05ad38 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
#[cfg(unix)]
mod capture;
#[cfg(unix)]
mod debug;
#[cfg(unix)]
mod osc133;
#[cfg(unix)]
mod pty_proxy;
#[cfg(unix)]
mod runtime;
#[cfg(unix)]
mod screen;

#[cfg(unix)]
pub use capture::{CommandCapture, CommandCaptureSink};
#[cfg(unix)]
pub use pty_proxy::PtyProxy;

#[cfg(not(unix))]
#[expect(dead_code)]
mod unsupported {
    use clap::{Args, Subcommand};

    #[derive(Args, Debug)]
    pub struct PtyProxy {
        /// Highlight OSC 133 prompt, input, output, and exit-code regions
        #[arg(long)]
        debug_osc133: bool,

        #[command(subcommand)]
        cmd: Option<Cmd>,
    }

    #[derive(Subcommand, Debug)]
    enum Cmd {
        /// Print shell code to initialize atuin pty-proxy on shell startup
        Init(Init),
    }

    #[derive(Args, Debug)]
    struct Init {
        /// Shell to generate init for. If omitted, attempt auto-detection
        shell: Option<String>,
    }
}

#[cfg(not(unix))]
pub use unsupported::PtyProxy;