mirror of
https://github.com/antos-rde/antosdk-apps.git
synced 2025-08-28 23:02:54 +02:00
fix vTerm paste from clipboard
This commit is contained in:
File diff suppressed because one or more lines are too long
@@ -6,7 +6,7 @@
|
||||
"author": "Xuan Sang LE",
|
||||
"email": "xsang.le@gmail.com"
|
||||
},
|
||||
"version":"0.1.4-a",
|
||||
"version":"0.1.5-a",
|
||||
"category":"System",
|
||||
"iconclass":"fa fa-terminal",
|
||||
"mimes":["none"],
|
||||
|
Binary file not shown.
@@ -75,11 +75,22 @@ class vTerm extends this.OS.application.BaseApplication
|
||||
mctxHandle: (data) ->
|
||||
switch data.id
|
||||
when "paste"
|
||||
@_api.getClipboard().then (text) =>
|
||||
cb = (text) =>
|
||||
return unless text and text isnt ""
|
||||
text = text.replace /\n/g, "\r"
|
||||
@sub.send Antunnel.Msg.DATA, new TextEncoder("utf-8").encode(text) if @sub
|
||||
@term.focus()
|
||||
.catch (e) => @error __("Unable to paste"), e
|
||||
|
||||
@_api.getClipboard()
|
||||
.then (text) =>
|
||||
cb(text)
|
||||
.catch (e) =>
|
||||
@error __("Unable to paste"), e
|
||||
#ask for user to enter the text manually
|
||||
@openDialog("TextDialog", { title: "Paste text"})
|
||||
.then (text) =>
|
||||
cb(text)
|
||||
.catch (err) => @error err.toString(), err
|
||||
when "copy"
|
||||
text = @term.getSelection()
|
||||
return unless text and text isnt ""
|
||||
|
@@ -6,7 +6,7 @@
|
||||
"author": "Xuan Sang LE",
|
||||
"email": "xsang.le@gmail.com"
|
||||
},
|
||||
"version":"0.1.4-a",
|
||||
"version":"0.1.5-a",
|
||||
"category":"System",
|
||||
"iconclass":"fa fa-terminal",
|
||||
"mimes":["none"],
|
||||
|
Reference in New Issue
Block a user