Compare commits

...

1 Commits
master ... evan

Author SHA1 Message Date
wenyifan
901d8e2366 修复ssh原生模式下无法复制粘贴问题 2022-08-24 16:08:11 +08:00

View File

@ -67,16 +67,13 @@ class Term extends Component {
this.setState({
selection: selection
})
if (navigator.clipboard) {
await navigator.clipboard.writeText(selection);
}
});
term.attachCustomKeyEventHandler((e) => {
if (e.ctrlKey && e.key === 'c' && this.state.selection) {
return false;
}
return !(e.ctrlKey && e.key === 'v');
return true;
});
document.body.oncopy = (event) => {
@ -84,14 +81,8 @@ class Term extends Component {
if (this.state.session['copy'] === '0') {
// message.warn('禁止复制')
return false;
}else {
if (event.clipboardData) {
return event.clipboardData.setData('text', '');
} else {
// 兼容IE
return window.clipboardData.setData("text", '');
}
}
return true;
}
document.body.onpaste = (event) => {