feat (blend-settings): add support for copying text, switch to JetBrains Mono

This commit is contained in:
Rudra Saraswat 2023-05-28 07:50:58 +05:30
parent 4f7c481ce9
commit e1374c1254
2 changed files with 14 additions and 2 deletions

View file

@ -44,7 +44,7 @@ function createTerminalWindow() {
terminalWindow.loadFile('src/pages/terminal.html')
terminalWindow.setMenu(null)
// terminalWindow.setMenu(null)
}
function loadTerminalWindow(title, cmd) {

View file

@ -69,13 +69,25 @@
experimentalCharAtlas: 'dynamic',
theme: {
background: '#242430'
}
},
fontFamily: 'JetBrains Mono'
});
once = true
term.loadAddon(fit)
term.attachCustomKeyEventHandler((arg) => {
if (arg.ctrlKey && arg.shiftKey && arg.code === "KeyC" && arg.type === "keydown") {
const selection = term.getSelection();
if (selection) {
navigator.clipboard.writeText(selection);
return false;
}
}
return true;
});
var term_e = document.getElementById('term');
term.open(term_e);
fit.fit()