mirror of
https://github.com/tsl0922/ttyd.git
synced 2026-01-07 03:14:22 +01:00
html: add empty check for copy
This commit is contained in:
@@ -141,6 +141,7 @@ export class Xterm extends Component<Props> {
|
||||
terminal.onResize(this.onTerminalResize);
|
||||
if (document.queryCommandSupported && document.queryCommandSupported('copy')) {
|
||||
terminal.onSelectionChange(() => {
|
||||
if (terminal.getSelection() === '') return;
|
||||
overlayAddon.showOverlay('\u2702', 200);
|
||||
document.execCommand('copy');
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user