Fixed file paste (#3383)

Fixes #3340
This commit is contained in:
Umberto Lentini 2019-01-06 06:55:16 -08:00 committed by CHaBou
parent a3db3670be
commit ba93421933
2 changed files with 9 additions and 3 deletions

View file

@ -189,7 +189,7 @@ export default class Term extends React.PureComponent {
if (processed) { if (processed) {
e.preventDefault(); e.preventDefault();
e.stopPropagation(); e.stopPropagation();
this.term.send(processed); this.term._core.handler(processed);
} }
} }

View file

@ -1,10 +1,16 @@
import {clipboard} from 'electron'; import {clipboard} from 'electron';
import plist from 'plist';
const getPath = platform => { const getPath = platform => {
switch (platform) { switch (platform) {
case 'darwin': { case 'darwin': {
const filepath = clipboard.read('public.file-url'); if (clipboard.has('NSFilenamesPboardType')) {
return filepath.replace('file://', ''); // Parse plist file containing the path list of copied files
const list = plist.parse(clipboard.read('NSFilenamesPboardType'));
return "'" + list.join("' '") + "'";
} else {
return null;
}
} }
case 'win32': { case 'win32': {
const filepath = clipboard.read('FileNameW'); const filepath = clipboard.read('FileNameW');