VScode: Same terminal output over multiple columns - visual-studio-code

I generally run a program where the output is not very wide but I find myself constantly scrolling up to see previous output - it runs on a timer. I would like to use up more of my monitor by having the output flow over three columns instead of just one big one with a lot of wasted screen real estate.
Is there any setting or extension in vscode that allows this?

Related

Can I have VS Code skip opening previous workspaces one time only?

I use many VS Code workspaces throughout the day. Most of them are backed by directories on NFS-mounted drives, which are only mounted while I'm VPN'd in to my employer's network. Opening VS Code while not VPN'd in will cause all of my windows to close, leaving me with blank/empty workspaces, and then I have to set them all back up again in the morning. It only takes a few minutes to do, but I'm lazy and it's not neat; I like things neat. I know that I can start VS Code without any workspaces using the -n option, which is great, but then the next time I start up the editor for real (i.e. for work purposes), all of my workspaces need to be reopened again (see previous statement re: I'm lazy and I like things neat).
Is there a way to indicate that I want to start VS Code without any project just this one time, and then the next time I start I want all of my old workspaces to reopen as normal? Alternately, does anyone know where the state information is stored and how to edit it? I have no qualms about saving it off and then restoring it after I'm done.
Absent any miracle solution, I've at least found the correct file to manipulate: the storage.json file, which on MacOS is found at:
~/Library/Application Support/Code/storage.json
I wrote a Perl script to do the manipulation. When I want to go "offline" it reads in the JSON file, loops through the opened windows, identifies the ones I don't want, and removes them using jq, then launches VS Code. When I'm ready to go back "online", I read a backup of the original file looking for the windows I previously removed, adds them back in (also using jq), and then launches VS Code.
The Perl script is a bit rough around the edges to be posted publicly, but people might find the jq helpful. To delete, you want to identify the windows to be removed as (zero-based) indexes in the array, and then delete them with the following:
jq '. | del(.windowsState.openedWindows[1,2,5])' '/Users/me/backups/online-storage.json' >'/Users/me/Library/Application Support/Code/storage.json'
If you want to add them back in at some point, you extract the full JSON bits from the backup file, and then use the following command to append them to the back of the array:
jq '.windowsState.openedWindows += [{"backupPath":"...",...,"workspaceIdentifier": {...}}, {"backupPath":"...",...,"workspaceIdentifier": {...}}, {"backupPath":"...",...,"workspaceIdentifier": {...}}]' '/Users/me/backups/offline-storage.json' >'/Users/me/Library/Application Support/Code/storage.json'
The inserted JSON is elided for clarity; you'll want to include the full JSON strings, of course. I don't know what significance the ordering has, so pulling them out of the middle of the array and appending them to the end of the array will likely have some consequence; it's not significant for my purposes, but YMMV.

Saving displayed values on the command window - MATLAB

I had a GUI to collect all data and to save it when I clicked a button. It displays a graph with all the data it collects. Unfortunately after collecting data for over 2 hours, it stopped. The data was 'precious'.
I don't know of any way to recover the data, but all of it was displayed in the command window. Is there a way I can retrieve all the data from the command window? Does MATLAB have a cache with all the values which I can access?
As long as matlab itself, (and the console in particular) is still responsive, you can just copy and paste everything out of the buffer into any text editor. Then, you can do a few minor edits, to get it into a text matlab input file, and you're good to go. Or if you've formatted your output correctly, you could put it into a text file, and read it in using readtable.
The key issue here, is how much memory do you have in your console window? I'm sure that can be tweaked up large, but did you bother to do that before you started running your GUI.
Note: In the future, always dump data to a log file as soon as it's collected! I've learned this lesson many times, the hard way.

Running two process in one command-line with split-screen

I need to split the command prompt window without making two windows. On one side I need a file to be read and on the other side (split with lines) to be command prompt gathering CPU Usage and RAM Usages. Things I need to know if I can do:
- Gather CPU and RAM Usage from command prompt or batch
- Have two process running side by side in the same window
- Read configuration files in a specific format (such as: server-dir=C:\Users...)
- Have both sides update every second with no glitches in graphics
Could it be done? An example of this would be handle (a minecraft server handler, can be seen here: http://goo.gl/t3741n)

printing text into a file in Matlab

I want to log the running of my program, specifically the running time of each part. At this moment I print to the screen using disp. Is there a way so that some of the things I print would also be printed into a text file?
You can use the DIARY command, that captures everything from the command window.
There are other solutions to this problem where you write to one or more logfiles opened when your program is running. This provides a permanent record without polluting your work space or diary. It also works well if you compile your MATLAB application.
Jan Simon has a nice solution at MATLAB Central which uses a persistant file id so the log to file mechanism can be used again and again throughout an application with many functions without passing the file id about.
Others at MATLAB Central (here and here) have developed class based solutions with more features.
Also, fprintf.

Horizontally scroll a text-based/console program

I am trying to use TestDisk (partition and file recovery program) to recover some files that I have lost. TestDisk runs as a text-based/console program and prints a long list of deleted files, one per line. Each file is listed as it's path and because I am running this from a rescue live linux cd, I am limited to a 80 character console.
I need to go though this list of files a select the ones I want to be undeleted, however I can only see the start of each path and..
...cuments and Settings\kin
...cuments and Settings\kin
...cuments and Settings\kin
...doesn't give me much information to go on (this list is probably over a hundred entries long).
I have been thinking about running TestDisk inside a screen session and hopefully increase the virtual terminal width and then simple scroll horizontally to the right. But screen doesn't seem to support something like this.
Is there anything that does?
I should clarify that TestDisk is a interactive console program. Thus I can not take the output and parse it with something else. Additionally I need the interactivity because when I find the files I want to undelete I need to select then inside TestDisk and then proceed to the next step in TestDisk.
Scroll lock?
Run the output through emacs. Then you can have all the functionality you want!