babakks / vscode-copy-from-terminal Goto Github PK
View Code? Open in Web Editor NEWCopy/pipe data from integrated terminal to a new VS Code editor/tab
License: MIT License
Copy/pipe data from integrated terminal to a new VS Code editor/tab
License: MIT License
Here what I see when I open a new terminal.
root@vps:~/mybatch/snippets# export COPY_TO_VSCODE_TEMP_DIR="/root/.vscode-server/extensions/babakks.vscode-copy-from-terminal-0.0.7/temp/" && export EXTENSION_INSTANCE_ID="aa47" && _get_temp_file() { dt="$(date --iso-8601=ns)" && tempfname="$dt-$EXTENSION_INSTANCE_ID.tmp" && echo "$COPY_TO_VSCODE_TEMP_DIR/$tempfname"; } && cp2code() { cat > "$(_get_temp_file)"; } && tee2code() { tee "$(_get_temp_file)"; } root@vps:~/mybatch/snippets#
cp2code works, but would be nice clean up it
Visual Studio Code Version 1.70.2
Let me know if you need more details
I keep getting errors on my mac using
_get_temp_file() {
dt="$(date --iso-8601=ns)"
tempfname="$dt-$EXTENSION_INSTANCE_ID.tmp"
echo "$COPY_TO_VSCODE_TEMP_DIR/$tempfname"
}
I changed the dt line to this:
dt="$(date +%s)"
Maybe it's not a real issue but let me explain.
I created a little bash to show your what I mean:
code test_cp2code.sh
`#!/bin/sh
ps -aux | cp2code
chmod +x
./test_cp2code.sh
line 2: cp2code: command not found
`
How I can use cp2code inside a bash script?
thx
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.