mirror of
https://github.com/kovidgoyal/kitty
synced 2026-07-08 21:25:32 +02:00
Ask for confirmation before doing a clone by default
This commit is contained in:
@@ -1015,8 +1015,11 @@ class Window:
|
||||
if not msg:
|
||||
if self.current_clone_data:
|
||||
cdata, self.current_clone_data = self.current_clone_data, ''
|
||||
from .launch import clone_and_launch
|
||||
clone_and_launch(cdata, self)
|
||||
get_boss().confirm(_(
|
||||
'A program running in this window wants to clone it into another window.'
|
||||
' Allow it do so, once?'),
|
||||
partial(self.handle_remote_clone_confirmation, cdata), window=self,
|
||||
)
|
||||
self.current_clone_data = ''
|
||||
return
|
||||
num, rest = msg.split(':', 1)
|
||||
@@ -1024,6 +1027,11 @@ class Window:
|
||||
self.current_clone_data = ''
|
||||
self.current_clone_data += rest
|
||||
|
||||
def handle_remote_clone_confirmation(self, cdata: str, confirmed: bool) -> None:
|
||||
if confirmed:
|
||||
from .launch import clone_and_launch
|
||||
clone_and_launch(cdata, self)
|
||||
|
||||
def handle_remote_askpass(self, msg: str) -> None:
|
||||
from .shm import SharedMemory
|
||||
with SharedMemory(name=msg, readonly=True) as shm:
|
||||
|
||||
Reference in New Issue
Block a user