I am running IPython on Windows 7 and can use the %paste magic command to paste from the clipboard. However, I cannot copy from IPython to the clipboard. I want to copy code snippets from IPython and paste them back to a text editor.
Anyone know a fix for this?
Found this gist to add a %copy magic command, my fork adds supports osx/linux/windows platforms.
I have yet to test it on windows, so please tell me if you encounter any issues.
As mentioned by #AdrianRatnapala, you can right-click in the terminal window and select Mark, mark the code snippets you want to copy, and then right-click (the marked content is copied to the clipboard when you right-click).
A more "permanent way" to use this feature is to right-click on the title bar of the terminal window and choose Properties. Under the Options tab, tick the box next to QuickEdit Mode and save this setting.
A third option is to use IPython's Qt Console. You can use this by entering ipython qtconsole in the command prompt.
A real permanent mode is to do what sodd has told, but a little bit different:
Right click in the top of the shell window, but use default instead properties option, also select options and Quick edit mode. Now this setting will survive in the next shell activations.
So it's very easy to copy and paste
Drag and drop to draw a rectangle inside shell screen and press Enter. The content is is in Clipboard. After, if you can paste this in the shell it's just press Right key or outside, use the usual Ctrl+V.
The cool thing is that you can now omit the number of commands in the copy.
Related
I need to enter code into WinSCP terminal.
How can I do that besides typing each symbol?
How can I simply copy and paste the command lines?
I tried "Ctrl+V" - doesnt work.
Does it required some different keyboard combination in order to paste test?
Righ-click on the Window header → Edit → Paste:
UPD: By the way, if you want to paste it without doing this every time, right-click on the Window header, choose "Properties", enable "QuickEdit Mode", and click "OK". Now you can paste strings with a single "right-click".
Additionally to the answer by #Victor, since Windows 10, Ctrl+V (and its companions) can be enabled using the console option Enable Ctrl key shortcuts (I actually believe that the option is enabled by default).
I work on Windows 7. Have the following problem. Want to copy a text from Anaconda prompt to a website.
I marked a given line in Ancaconda prompt, I click 'mark' in the menu, mark the text - but when I click right the marking vanishes. I also tried Ctrl-C and Ctrl-V but it doesn't work either. What is my mistake?
Step 1: Right click on the title bar of the Anaconda Prompt.
Step 2: Select Properties.
Step 3: Under Options section, select all the check boxes of Edit Options and Text Selection, then click OK
Hope this helps.
Ctrl+C to copy anything from anywhere, as usualRIGHT CLIC inside Anaconda Prompt window to paste
Right click on the title bar of the Anaconda Prompt.
Select Default Value instead of Properties.
Check last term of Edit Options.
Restart the Prompt.
It's simple.
USE:
Copy: Enter
Paste: Ctrl +V
I found how to do this.
You select the text you want, then *don't * do Ctrl-c or any other combination. Instead right click the title bar and check in the menu that appears a "Copy" option. (I think it is inside another menu).
Once you do this, the text is copied in the correct way and you can just Ctrl-V in your own application, editor , etc
In Terminal, I can simply to cmd+up arrow. How can I do this in iTerm2? I've tried the cmd+shift+up arrow option, but it doesn't work reliably, especially when there is a currently running process.
You can do this with Shell Integration! By default, iTerm2 is not fully integrated with the shell (e.g. Bash) itself. It doesn't really know which lines are prompt and which are output, so it wouldn't know what line to jump you back to as the previous prompt. If you install shell integration, it'll automatically add a mark at each prompt line and you'll be able to cycle up and down with Command-Shift-Up Arrow and Command-Shift-Down Arrow respectively. On my machine this worked even while a process was running.
In Preferences > Keys you can change the default keybindings back to what you're used to. Double click on Command-Up Arrow, change the Action to Select Menu Item..., and set the menu item to Edit > Marks and Annotations > Previous Mark/Annotation. Repeat with Next Mark/Annotation for Command-Down Arrow.
EDITED 2020-03-30: It appears Mark and Annotation were separated into different menu items in a recent update. You should now use Next Mark instead.
I'm trying to write my function's arguments in a text editor and paste them into the console, but the console won't let me.
(My list of arguments is long and the formatting starts to go crazy.)
I'm using ghci running in a cmd.exe window.
What can I do?
As pointed out in the comments, in a windows console you can right-click the title bar and do Edit > Paste.
If you'd rather just right-click in the window to paste immediately, you can turn on QuickEdit Mode:
Right-click the title bar of the window, and choose Properties.
Select the Options tab
In Edit Options, tick QuickEdit Mode
Click OK, and when it asks you, choose
Save properties for future windows with the same title. This means it'll happen every time you run ghci.
Works under XP, and as far as I can tell via Google, the same trick works in Vista and Windows 7.
This also has the effect that you don't need to choose Edit > Mark to select text. (Press enter after selecting to copy, and of course, right-click to paste.)
How can I copy and paste in irb (Interactive Ruby Shell) on Windows?
To avoid having to open the drop-down menu and clicking, you need to change the command window settings. To do this, right-click the title bar, choose Properties, turn on "QuickEdit Mode" under the Properties tab (and keep "Insert Mode" on), then OK.
Now, to copy: drag to select, right-click to copy.
To paste: right-click with no selection.
To copy: Hit alt-space, choose Edit, choose Mark, drag-select the text, hit enter.
To paste: Hit alt-space, choose Edit, choose Paste.
For CLI copy/paste:
Copy : Ctrl+insert
Paste : Shift+insert
You might want to consider using Console, a replacement for Windows' terrible command-line chrome. It offers fully redefinable keyboard shortcuts plus tabs, so it's ideal for IRB.
check out console2--very nice and allows you to paste by using right click or what not.
Update: conemu is even better: http://conemu.github.io/