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
49
50
51
52
# Cyberterm shell integration for bash (4.4+).
#
# eval "$(cyberterm +shell-integration bash)" # in ~/.bashrc
#
# Reports the working directory (OSC 7) and marks each prompt and command
# (OSC 133) so Cyberterm can jump between prompts and remember exit codes.
||
&&
_CYBERTERM_INTEGRATED=1
_cyberterm_running=0
# The command about to run (history's newest entry), percent-encoded.
# PS0 is expanded after a command line is read, right before it runs. The
# array-subscript arithmetic sets the flag in this shell (not a subshell)
# while expanding to nothing; the command line rides along on 133;C.
PS0='${_cyberterm_noop[$((_cyberterm_running=1))]}\e]133;C;cmdline_url=$(_cyberterm_cmdline)\a'""
PROMPT_COMMAND="_cyberterm_prompt_command"