diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json new file mode 100644 index 0000000..6598507 --- /dev/null +++ b/.devcontainer/devcontainer.json @@ -0,0 +1,42 @@ +// For format details, see https://aka.ms/devcontainer.json. For config options, see the +// README at: https://github.com/devcontainers/templates/tree/main/src/javascript-node +{ + "name": "Node.js & TypeScript", + // Or use a Dockerfile or Docker Compose file. More info: https://containers.dev/guide/dockerfile + "image": "mcr.microsoft.com/devcontainers/base:jammy", + // mount the ssh public identity file for the this project + // I limit to just what I need and not the whole ~/.ssh folder + "mounts": [ + "source=${localEnv:HOME}${localEnv:USERPROFILE}/.ssh/personal_id_rsa.pub,target=/home/vscode/.hostssh/id_rsa.pub,readonly,type=bind,consistency=cached" + ], + // Features to add to the dev container. More info: https://containers.dev/features. + "features": { + "ghcr.io/devcontainers-contrib/features/node-asdf": {}, + "ghcr.io/devcontainers/features/docker-outside-of-docker:1": {} + }, + + // Use 'forwardPorts' to make a list of ports inside the container available locally. + // "forwardPorts": [], + + "customizations": { + "vscode": { + "extensions": [ + "mechatroner.rainbow-csv", + "ms-vscode-remote.remote-containers", + "dbaeumer.vscode-eslint", + "GitHub.copilot", + "GitHub.copilot-chat", + "esbenp.prettier-vscode", + "rvest.vs-code-prettier-eslint", + "bierner.markdown-mermaid", + "stylelint.vscode-stylelint" + ] + } + }, + + // Use 'postCreateCommand' to run commands after the container is created. + "postCreateCommand": "/bin/bash ./.devcontainer/scripts/tools.sh >> ~/post-create-tools.log" + + // Uncomment to connect as root instead. More info: https://aka.ms/dev-containers-non-root. + // "remoteUser": "root" +} diff --git a/.devcontainer/scripts/tools.sh b/.devcontainer/scripts/tools.sh new file mode 100644 index 0000000..a75a4d3 --- /dev/null +++ b/.devcontainer/scripts/tools.sh @@ -0,0 +1,18 @@ +#!/bin/bash + +mkdir -p ~/.ssh && \ + touch ~/.ssh/known_hosts && \ + sudo tee ~/.ssh/config > /dev/null << EOF +Host github.com + HostName github.com + PreferredAuthentications publickey + IdentityFile ~/.hostssh/id_rsa.pub +EOF + +sudo chown -R vscode:vscode ~/.ssh + +# Install Node.js 6.9.1 +asdf install nodejs 6.9.1 +asdf local nodejs 6.9.1 + +git config --global --add safe.directory /workspaces/webssh2 \ No newline at end of file diff --git a/.tool-versions b/.tool-versions new file mode 100644 index 0000000..ebe704a --- /dev/null +++ b/.tool-versions @@ -0,0 +1 @@ +nodejs 6.9.1 diff --git a/app/client/src/js/index.js b/app/client/src/js/index.js index 5814e9b..e6daa70 100644 --- a/app/client/src/js/index.js +++ b/app/client/src/js/index.js @@ -234,3 +234,13 @@ function downloadLog () { // eslint-disable-line } term.focus() } + +// Add an event listener for capturing Ctrl + Shift + 6 +document.addEventListener('keydown', function(event) { + if (event.ctrlKey && event.shiftKey && event.code === 'Digit6') { + // Prevent the default action + event.preventDefault(); + // Emit the desired key sequence to the server + socket.emit('data', '\x1E'); // 0x1E is the RS control character + } +}); \ No newline at end of file