euporie.core.terminal
Contain classes related to querying terminal features.
Functions
|
Add a command to the centralized command system. |
|
Decode the Base64 encoded bytes-like object or ASCII string s. |
|
Suspend the current app and edit a file in an external editor. |
|
Add a new member to an existing Enum. |
|
Get the current active (running) Application. |
|
Least-recently-used cache decorator. |
|
Wrap an escape sequence for terminal passthrough. |
|
Update the key-binding registry. |
|
Run function on the terminal above the current application or prompt. |
Classes
|
A terminal query to retrieve clipboard contents. |
|
Possible color depth values for the output. |
|
A terminal query to retrieve colours as hex codes. |
|
A terminal query to check for CSI-u support. |
|
Determine the suspected color depth of the terminal. |
|
Simple event to which event handlers can be attached. For instance::. |
|
A terminal query to check for iTerm graphics support. |
|
Statemachine that receives |
|
List of keys for use in key bindings. |
|
A terminal query to check for kitty graphics support. |
|
A terminal query to check the terminal's dimensions in pixels. |
|
A terminal query to check for Pixel SGR support. |
|
A terminal query to check for sixel graphics support. |
|
A class to gather and hold information about the terminal. |
|
A class representing a terminal query. |
alias of |
- class euporie.core.terminal.ClipboardData(input_: Input, output: Output, config: Config)
Bases:
TerminalQuery
A terminal query to retrieve clipboard contents.
- cache = False
- cmd = '\x1b]52;c;?\x1b\\'
- pattern: re.Pattern | None = re.compile('^\\x1b\\]52;(?:c|p)?;(?P<data>[A-Za-z0-9+/=]+)\\x1b\\\\\\Z')
- property value: Any
Return the last known value for the query.
- Returns:
The last value received, or the default value.
- class euporie.core.terminal.Colors(input_: Input, output: Output, config: Config)
Bases:
TerminalQuery
A terminal query to retrieve colours as hex codes.
- cache = True
- cmd = '\x1b]10;?\x1b\\\x1b]11;?\x1b\\\x1b]4;0;?\x1b\\\x1b]4;1;?\x1b\\\x1b]4;2;?\x1b\\\x1b]4;3;?\x1b\\\x1b]4;4;?\x1b\\\x1b]4;5;?\x1b\\\x1b]4;6;?\x1b\\\x1b]4;7;?\x1b\\\x1b]4;8;?\x1b\\\x1b]4;9;?\x1b\\\x1b]4;10;?\x1b\\\x1b]4;11;?\x1b\\\x1b]4;12;?\x1b\\\x1b]4;13;?\x1b\\\x1b]4;14;?\x1b\\\x1b]4;15;?\x1b\\'
- default: Any | None = {'ansiblack': '#000000', 'ansiblue': '#0d73cc', 'ansibrightblack': '#767676', 'ansibrightblue': '#1a8fff', 'ansibrightcyan': '#14ffff', 'ansibrightgreen': '#23fd00', 'ansibrightmagenta': '#fd28ff', 'ansibrightpurple': '#fd28ff', 'ansibrightred': '#f2201f', 'ansibrightwhite': '#ffffff', 'ansibrightyellow': '#fffd00', 'ansicyan': '#0dcdcd', 'ansigray': '#767676', 'ansigreen': '#19cb00', 'ansimagenta': '#cb1ed1', 'ansipurple': '#9841bb', 'ansired': '#cc0403', 'ansiwhite': '#dddddd', 'ansiyellow': '#cecb00', 'bg': '#232627', 'fg': '#fcfcfc'}
- pattern: re.Pattern | None = re.compile('^\\x1b\\](?P<c>(\\d+;)?\\d+)+;rgb:(?P<r>[0-9A-Fa-f]{2,4})\\/(?P<g>[0-9A-Fa-f]{2,4})\\/(?P<b>[0-9A-Fa-f]{2,4})(\\x1b\\\\\\Z|\\0x7)')
- property value: Any
Return the last known value for the query.
- Returns:
The last value received, or the default value.
- class euporie.core.terminal.CsiUStatus(input_: Input, output: Output, config: Config)
Bases:
TerminalQuery
A terminal query to check for CSI-u support.
- cache = True
- cmd = '\x1b[?u'
- pattern: re.Pattern | None = re.compile('^\\x1b\\[\\?\\d+u')
- property value: Any
Return the last known value for the query.
- Returns:
The last value received, or the default value.
- class euporie.core.terminal.DepthOfColor(input_: Input, output: Output, config: Config)
Bases:
TerminalQuery
Determine the suspected color depth of the terminal.
- cache = False
- cmd = ''
- pattern: re.Pattern | None = None
- property value: Any
Return the last known value for the query.
- Returns:
The last value received, or the default value.
- class euporie.core.terminal.ItermGraphicsStatus(input_: Input, output: Output, config: Config)
Bases:
TerminalQuery
A terminal query to check for iTerm graphics support.
- cache = True
- cmd = '\x1b[>q'
- pattern: re.Pattern | None = re.compile('^\\x1bP>\\|(?P<term>[^\\x1b]+)\\x1b\\\\')
- property value: Any
Return the last known value for the query.
- Returns:
The last value received, or the default value.
- class euporie.core.terminal.KittyGraphicsStatus(input_: Input, output: Output, config: Config)
Bases:
TerminalQuery
A terminal query to check for kitty graphics support.
- cache = True
- cmd = '\x1b_Gi=4294967295,s=1,v=1,a=q,t=d,f=24;AAAA\x1b\\'
- pattern: re.Pattern | None = re.compile('^\\x1b_Gi=(4294967295|0);(?P<status>OK)\\x1b\\\\\\Z')
- property value: Any
Return the last known value for the query.
- Returns:
The last value received, or the default value.
- class euporie.core.terminal.PixelDimensions(input_: Input, output: Output, config: Config)
Bases:
TerminalQuery
A terminal query to check the terminal’s dimensions in pixels.
- cache = True
- cmd = '\x1b[14t'
- pattern: re.Pattern | None = re.compile('^\\x1b\\[4;(?P<y>\\d+);(?P<x>\\d+)t')
- property value: Any
Return the last known value for the query.
- Returns:
The last value received, or the default value.
- class euporie.core.terminal.SgrPixelStatus(input_: Input, output: Output, config: Config)
Bases:
TerminalQuery
A terminal query to check for Pixel SGR support.
- cache = True
- cmd = '\x1b[?1016h\x1b[?1016$p\x1b[?1016l'
- pattern: re.Pattern | None = re.compile('^\\x1b\\[\\?1016;(?P<Pm>\\d)\\$\\Z')
- property value: Any
Return the last known value for the query.
- Returns:
The last value received, or the default value.
- class euporie.core.terminal.SixelGraphicsStatus(input_: Input, output: Output, config: Config)
Bases:
TerminalQuery
A terminal query to check for sixel graphics support.
- cache = True
- cmd = '\x1b[c'
- pattern: re.Pattern | None = re.compile('^\\x1b\\[\\?(?:\\d+;)*(?P<sixel>4)(?:;\\d+)*c\\Z')
- property value: Any
Return the last known value for the query.
- Returns:
The last value received, or the default value.
- class euporie.core.terminal.TerminalInfo(input_: Input, output: Output, config: Config)
Bases:
object
A class to gather and hold information about the terminal.
- input: Input
- output: Output
- register(query: type[euporie.core.terminal.TerminalQuery]) TerminalQuery
Instantiate and registers a query’s response with the input parser.
- class euporie.core.terminal.TerminalQuery(input_: Input, output: Output, config: Config)
Bases:
object
A class representing a terminal query.
This allows a control sequence to sent to the terminal, the response interpreted, and the received value processed and stored.
- cache = False
- cmd = ''
- pattern: re.Pattern | None = None
- property value: Any
Return the last known value for the query.
- Returns:
The last value received, or the default value.