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) {
e.preventDefault();
e.stopPropagation();
this.term.send(processed);
this.term._core.handler(processed);
}
}

View file

@ -1,10 +1,16 @@
import {clipboard} from 'electron';
import plist from 'plist';
const getPath = platform => {
switch (platform) {
case 'darwin': {
const filepath = clipboard.read('public.file-url');
return filepath.replace('file://', '');
if (clipboard.has('NSFilenamesPboardType')) {
// 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': {
const filepath = clipboard.read('FileNameW');