mirror of
https://github.com/tsl0922/ttyd.git
synced 2026-02-06 01:54:24 +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');
|
||||
});
|
||||
|
||||
2
src/index.html
vendored
2
src/index.html
vendored
File diff suppressed because one or more lines are too long
Reference in New Issue
Block a user