Clearing the screen by printing a character?

If you want to clear the screen, the “ANSI” sequence in a printf \033[2J clears the entire screen, e.g., printf ‘\033[2J’ The command-line clear program uses this, along with moving the cursor to the “home” position, again an “ANSI” sequence: \033[H The program gets the information from the terminal database. For example, for TERM=vt100, it … Read more

Save terminal tabs to saved workspace VSCode

Look at the Restore Terminals extension. For example, in your settings.json: “restoreTerminals.runOnStartup”: false, // true is the default // set to false if using a keybinding or command palette “restoreTerminals.terminals”: [ { “splitTerminals”: [ { “name”: “git”, “commands”: [ “cd <your directory>”, “npm run test” // your git command(s) ] } ] }, { “splitTerminals”: … Read more

Why is the default terminal width 80 characters?

As per Wikipedia: 80 chars per line is historically descended from punched cards and later broadly used in monitor text mode source: http://en.wikipedia.org/wiki/Characters_per_line Shall I still use 80 CPL? Many developers argue to use 80 CPL even if you could use more. Quoting from: http://richarddingwall.name/2008/05/31/is-the-80-character-line-limit-still-relevant/ Long lines that span too far across the monitor are … Read more

Shortcut for running terminal command in VS code

Typically you would set up a build or another task or an npm script and then trigger that with a hotkey. There is another new way to do it with send text to the terminal. For example, try this in your keybindings (Preferences: Open Keyboard Shortcuts (JSON)): { “key”: “ctrl+alt+u”, “command”: “workbench.action.terminal.sendSequence”, “args”: { “text”: … Read more

How to use qemu to run a non-gui OS on the terminal?

You can compile qemu for youself and install it into your home directory. There will be no kernel-mode qemu accelerator, but the qemu will work and the speed will be rather high. Qemu has two options for non-gui start: http://wiki.qemu.org/download/qemu-doc.html 2.3.4 Display options: -nographic Normally, QEMU uses SDL to display the VGA output. With this … Read more

VS Code Refresh Integrated Terminal Environment Variables without Restart/Logout

You need to run the following line in a new window of one of your terminals (Command Prompt, Powershell, …): code It will open ‘VS Code’ once from them. Now you can close and re-open ‘VS Code’ again as many time as you want using its normal shortcuts and have your environment variables.