Entry point to edit config file
This commit is contained in:
parent
ef6164eecb
commit
c440470276
@ -65,6 +65,11 @@ def run_kitten(args: List[str]) -> None:
|
|||||||
rk(kitten)
|
rk(kitten)
|
||||||
|
|
||||||
|
|
||||||
|
def edit_config_file(args: List[str]) -> None:
|
||||||
|
from kitty.utils import edit_config_file as f
|
||||||
|
f()
|
||||||
|
|
||||||
|
|
||||||
def namespaced(args: List[str]) -> None:
|
def namespaced(args: List[str]) -> None:
|
||||||
func = namespaced_entry_points[args[1]]
|
func = namespaced_entry_points[args[1]]
|
||||||
func(args[1:])
|
func(args[1:])
|
||||||
@ -77,6 +82,7 @@ entry_points = {
|
|||||||
'runpy': runpy,
|
'runpy': runpy,
|
||||||
'launch': launch,
|
'launch': launch,
|
||||||
'kitten': run_kitten,
|
'kitten': run_kitten,
|
||||||
|
'edit-config': edit_config_file,
|
||||||
|
|
||||||
'@': remote_control,
|
'@': remote_control,
|
||||||
'+': namespaced,
|
'+': namespaced,
|
||||||
|
|||||||
@ -580,6 +580,13 @@ def parse_uri_list(text: str) -> Generator[str, None, None]:
|
|||||||
yield unquote(purl.path)
|
yield unquote(purl.path)
|
||||||
|
|
||||||
|
|
||||||
|
def edit_config_file() -> None:
|
||||||
|
from kitty.config import prepare_config_file_for_editing
|
||||||
|
p = prepare_config_file_for_editing()
|
||||||
|
editor = get_editor()
|
||||||
|
os.execvp(editor[0], editor + [p])
|
||||||
|
|
||||||
|
|
||||||
class SSHConnectionData(NamedTuple):
|
class SSHConnectionData(NamedTuple):
|
||||||
binary: str
|
binary: str
|
||||||
hostname: str
|
hostname: str
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user