mirror of
https://github.com/kovidgoyal/kitty
synced 2026-07-21 07:55:10 +02:00
DRYer: Get hostname
This commit is contained in:
@@ -4,12 +4,13 @@
|
||||
import os
|
||||
import re
|
||||
import signal
|
||||
import socket
|
||||
import subprocess
|
||||
import sys
|
||||
from typing import Callable, cast
|
||||
from urllib.parse import quote_from_bytes
|
||||
|
||||
from kitty.utils import get_hostname
|
||||
|
||||
|
||||
def write_hyperlink(write: Callable[[bytes], None], url: bytes, line: bytes, frag: bytes = b'') -> None:
|
||||
text = b'\033]8;;' + url
|
||||
@@ -76,7 +77,7 @@ def main() -> None:
|
||||
num_pat = re.compile(br'^(\d+)([:-])')
|
||||
|
||||
in_result: bytes = b''
|
||||
hostname = socket.gethostname().encode('utf-8')
|
||||
hostname = get_hostname().encode('utf-8')
|
||||
|
||||
try:
|
||||
for line in p.stdout:
|
||||
|
||||
Reference in New Issue
Block a user