This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/env python3.7 | |
| import iterm2 | |
| async def main(connection): | |
| app = await iterm2.async_get_app(connection) | |
| session = app.current_terminal_window.current_tab.current_session | |
| async with session.get_screen_streamer(want_contents=True) as streamer: | |
| while True: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/env python3.7 | |
| import iterm2 | |
| async def main(connection): | |
| app = await iterm2.async_get_app(connection) | |
| session = app.current_terminal_window.current_tab.current_session | |
| contents = await session.async_get_screen_contents() | |
| for i in range(contents.number_of_lines): |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| (unless (display-graphic-p) | |
| (add-hook 'after-make-frame-functions | |
| '(lambda | |
| ;; Take advantage of iterm2's CSI u support (https://gitlab.com/gnachman/iterm2/-/issues/8382). | |
| (xterm--init-modify-other-keys) | |
| ;; Courtesy https://emacs.stackexchange.com/a/13957, modified per | |
| ;; https://gitlab.com/gnachman/iterm2/-/issues/8382#note_365264207 | |
| (defun character-apply-modifiers (c &rest modifiers) | |
| "Apply modifiers to the character C. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| _NXShowKeyAndMain | |
| 0x7fff35b16cf3 <+0>: pushq %rbp | |
| 0x7fff35b16cf4 <+1>: movq %rsp, %rbp | |
| 0x7fff35b16cf7 <+4>: pushq %r15 | |
| 0x7fff35b16cf9 <+6>: pushq %r14 | |
| 0x7fff35b16cfb <+8>: pushq %r13 | |
| 0x7fff35b16cfd <+10>: pushq %r12 | |
| 0x7fff35b16cff <+12>: pushq %rbx | |
| 0x7fff35b16d00 <+13>: pushq %rax | |
| 0x7fff35b16d01 <+14>: leaq 0x5a1c6c90(%rip), %r15 ; NSApp |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/dash | |
| __tf_decode() { | |
| local TABLE="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/" | |
| local COUNT=0 | |
| local ACCUMULATOR=0 | |
| local SKIP=0 | |
| local ENCODED="$1" | |
| local REMAINING="$ENCODED" | |
| local FEATURES="8 VERSION 1 24BIT_BASIC 1 24BIT_FULL 1 CLIPBOARD_WRITE 1 DECSLRM 1 MOUSE_BASIC 1 MOUSE_ALT_SCROLL 1 UTF8 1 DECSCUSR_BASIC 1 DECSCUSR_BAR 1 AMBIGUOUS_FULLWIDTH 4 UNICODE_VERSION 1 RTL_LEVEL1 1 RTL_LEVEL2 1 TITLE_SETTING 1 BRACKETED_PASTE 1 FOCUS_REPORTING 1 CWD 1 BCE 1 UNDERLINE_STYLING 1 UNDERLINE_STYLE_DOUBLE 1 UNDERLINE_STYLE_CURLY 1 UNDERLINE_STYLE_DOTTED 1 UNDERLINE_STYLE_DASHED 1 STRIKETHROUGH 1 OVERLINE 1 SYNC 1 HYPERLINKS 1 NOTIFICATIONS 1 SIXEL 1 ITALICS 1 INVERSE_7 0 EOF" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import asyncio | |
| import iterm2 | |
| pending = False | |
| last_coro = None | |
| async def main(connection): | |
| loop = asyncio.get_event_loop() | |
| async def really_notify(message, window_id): |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import iterm2 | |
| async def main(connection): | |
| app = await iterm2.async_get_app(connection) | |
| window = app.current_terminal_window | |
| tab = window.tabs[0] | |
| print(f'Before: {tab.sessions}') | |
| await tab.sessions[0].async_split_pane() | |
| print(f'After: {tab.sessions}') |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <pre id="changelist7330916824228127372" style="display: none">The only change in version 3.2.9 vs 3.2.8 is that | |
| it was built with libssh2 1.8.2 because of a | |
| security vulnerability. iTerm2 version 3.2.8 was | |
| built with libssh2 1.8.0. | |
| More information on the vulnerability in libssh2 | |
| may be found here: | |
| https://nvd.nist.gov/vuln/detail/CVE-2019-3855 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/env python3 | |
| import asyncio | |
| import iterm2 | |
| async def main(connection): | |
| async def update(theme): | |
| # Themes have space-delimited attributes, one of which will be light or dark. | |
| parts = theme.split(" ") | |
| if "dark" in parts: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import re | |
| async def main(connection): | |
| app = await iterm2.async_get_app(connection) | |
| # This regex splits the font into its name and size. Fonts always end with | |
| # their size in points, preceded by a space. | |
| r = re.compile(r'^(.* )(\d*)$') | |
| @iterm2.RPC | |
| async def increase_font_size(session_id): |