mirror of
https://github.com/kovidgoyal/kitty
synced 2026-07-18 22:44:50 +02:00
Get the quake terminal working on macOS
This commit is contained in:
@@ -12,6 +12,7 @@ import os
|
||||
import re
|
||||
import subprocess
|
||||
import sys
|
||||
import textwrap
|
||||
import time
|
||||
from functools import lru_cache, partial
|
||||
from typing import Any, Callable, Dict, Iterable, Iterator, List, Tuple
|
||||
@@ -30,6 +31,7 @@ if kitty_src not in sys.path:
|
||||
from kitty.conf.types import Definition, expand_opt_references # noqa
|
||||
from kitty.constants import str_version, website_url # noqa
|
||||
from kitty.fast_data_types import Shlex, TEXT_SIZE_CODE # noqa
|
||||
from kittens.panel.main import default_quake_cmdline # noqa
|
||||
|
||||
# config {{{
|
||||
# -- Project information -----------------------------------------------------
|
||||
@@ -120,6 +122,9 @@ string_replacements = {
|
||||
'_kitty_install_cmd': 'curl -L https://sw.kovidgoyal.net/kitty/installer.sh | sh /dev/stdin',
|
||||
'_build_go_version': go_version('../go.mod'),
|
||||
'_text_size_code': str(TEXT_SIZE_CODE),
|
||||
'_default_quake_cmdline': textwrap.fill(
|
||||
default_quake_cmdline, break_on_hyphens=False, break_long_words=False, initial_indent=' ' * 4, subsequent_indent=' ' * 8, width=77,
|
||||
).replace('\n', ' \\\n'),
|
||||
}
|
||||
|
||||
|
||||
@@ -352,7 +357,7 @@ def write_remote_control_protocol_docs() -> None: # {{{
|
||||
|
||||
def replace_string(app: Any, docname: str, source: List[str]) -> None: # {{{
|
||||
src = source[0]
|
||||
for k, v in app.config.string_replacements.items():
|
||||
for k, v in string_replacements.items():
|
||||
src = src.replace(k, v)
|
||||
source[0] = src
|
||||
# }}}
|
||||
@@ -769,7 +774,6 @@ def setup(app: Any) -> None:
|
||||
write_remote_control_protocol_docs()
|
||||
write_color_names_table()
|
||||
write_conf_docs(app, kn)
|
||||
app.add_config_value('string_replacements', {}, True)
|
||||
app.connect('source-read', replace_string)
|
||||
app.add_config_value('analytics_id', '', 'env')
|
||||
app.connect('html-page-context', add_html_context)
|
||||
|
||||
Reference in New Issue
Block a user