aboutsummaryrefslogtreecommitdiff
path: root/src/server/terminal_attach.rs
blob: 01fc899f5011c579f342cdc2056be955356289b9 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
pub(crate) fn paste_payload_for_runtime(
    runtime: &crate::terminal::TerminalRuntime,
    text: &str,
) -> String {
    if runtime
        .input_state()
        .map(|state| state.bracketed_paste)
        .unwrap_or(false)
    {
        format!("\x1b[200~{text}\x1b[201~")
    } else {
        text.to_owned()
    }
}