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.)
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).
One of my primary tools used for programming is my Terminal. It makes my programming process more efficient when I'm able to quickly open a Terminal window.
In Ubuntu, I was using (window+Alt+T) to open Terminal. But now I use a Macbook at my programming job.
Sometimes I use Spotlight to search "Terminal", and press Enter.
I'd like to know if I can assign a keyboard hotkey to do it.
I tested the following procedure under macOS Mojave 10.14.6 (18G3020).
Launch Automator. Create a document of type “Quick Action”:
(In older versions of macOS, use the “Service” template.)
In the new Automator document, add a “Run AppleScript” action. (You can type “run applescript” into the search field at the top of the action list to find it.) Here's the AppleScript to paste into the action:
on run {input, parameters}
tell application "Terminal"
if it is running then
do script ""
end if
activate
end tell
end run
Set the “Workflow receives” popup to “no input”. It should look like this overall:
Save the document with the name “New Terminal”. Then go to the Automator menu (or the app menu in any running application) and open the Services submenu. You should now see the “New Terminal” quick action:
If you click the “New Terminal” menu item, you'll get a dialog box:
Click OK to allow the action to run. You'll see this dialog once in each application that's frontmost when you use the action. In other words, the first time you use the action while Finder is frontmost, you'll see the dialog. And the first time you use the action while Safari is frontmost, you'll see the dialog. And so on.
After you click OK in the dialog, Terminal should open a new window.
To assign a keyboard shortcut to the quick action, choose the “Services Preferences…” item from the Services menu. (Or launch System Preferences, choose the Keyboard pane, then choose the Shortcuts tab, then choose Services from the left-hand list.) Scroll to the bottom of the right-hand list and find the New Terminal service. Click it and you should see an “Add Shortcut” button:
Click the button and press your preferred keyboard shortcut. Then, scratch your head, because (when I tried it) the Add Shortcut button reappears. But click the button again and you should see your shortcut:
Now you should be able to press your keyboard shortcut in most circumstances to get a new terminal window.
As programmers we want the quickest, most fool-proof way to get our tools in order so we can start hacking. Here are how I got it to work in MacOS 10.13.1 (High Sierra):
Option 1: Go to System Preferences | Keyboard | Shortcut | Services.
Under Files and Folders section, enable New Terminal at Folder
and/or New Terminal Tab at Folder and assign a shortcut key to it.
Option 2: If you want the shortcut key to work anywhere, create a new Service using Automator, then go to the Keyboard Shortcut to assign a shortcut key to it. Known limitation: not work from the desktop
Notes:
If the shortcut doesn't work, it might be in conflict with another
key binding (and the OS wouldn't warn you), try something else, e.g.
if ⇧⌥T doesn't work, try ⇧⌘T.
Don't spell-correct MacOS, that's not necessary.
iTerm2 - an alternative to Terminal - has an option to use configurable system-wide hotkey to show/hide (initially set to Alt+Space, disabled by default)
There is a third party app called hotkey app which can launch apps based on the configured shortcuts.
You can install it and setup required shortcut.
https://codenuts.de/en/posts/hotkey/
As others mentioned already, use the keyboard shortcut from services. I also had to restart the computer to take into effect.
mac - "command + t" will open a new terminal window.
Try command + t.
It works for me.
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.
How can I set the position for the output prompt in Visual Studio 2008 when debugging is started?
I have two screens and I want the prompt to always appear on my second screen so that I still can see the code on the primary screen, I have tried some tricks but I haven't got it right.
I'm not sure what you mean by "outputprompt". If you are creating a command line application and are talking about the command window, then
position the window where you want it (you can pause you app if it closes too fast)
click on its system menu, then click on properties
on the third tab of the appearing properties dialog, enter the values you like (be sure to uncheck automatic window positioning)
close the dialog by clicking OK
in the dialog that appears, pick the option that changes the link, instead of just changing the current window (I'm not sure either a German or English translation of the options is helpful for you)
HTH.
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/