So, now I have many open apps, often 3-4 powershell consoles. I'm able to order the powershell windows to watch them together (top left, top right, bottom left, bottom right).
So this means that if I switch to another app, when I switch back I have to restore all multiple powershell windows to see them all again.
What I want is, to create only one 'shared window' for many powershell, because when I need one, I need all of them to see.
Is there a way to do this?
Just to add more details about Windows Terminal approach:
Open a Windows Terminal
Type Alt+Shift+= or Alt+Shift+- to open a new Pane in the same tab
Type Shift+Ctrl+W to close the current Pane
If you need more details or modify the settings, go to next page Panes in Windows Terminal
ConEmu has this option.
You can also configure it to open as much consoles as you want when it starts.
ConEmu website
Enjoy!
VSCode can have Multiple Terminals which is the closest to this I've seen, quoted from documentaion:
You can create multiple terminals open to different locations and easily navigate between them. Terminal instances can be added by hitting the plus icon on the top-right of the TERMINAL panel or by triggering the Ctrl+Shift+` command. This creates another entry in the dropdown list that can be used to switch between them.
You can also split the terminal by triggering the Ctrl+\ command or via the right click context menu
Windows now provides the Windows Terminal.
Windows Terminal can split the terminal into panes and can also run different shells (i.e. cmd, powershell, and bash through the wsl)
You can install Windows Terminal directly from the Windows Store.
Create a virtual machine where you can run your PowerShell sessions uninterrupted. The PowerShell windows are always where I placed them when I come back.
It could be an expensive solution depending on your needs, but I have been doing this a long time. It's a robust solution since the only user processes on the VM are my PowerShell sessions.
Related
If I launch Windows Terminal, which, in turn, launches an instance of PowerShell 7.2.6 it looks different than if I simply launch PowerShell 7.2.6.
The top image is Windows Terminal with a PowerShell tab. Bottom image is PowerShell by itself.
Not only is the Windows Terminal version far more legible, it also renders ANSI escape codes correctly (color, cursor positioning, etc.). The stand-alone PowerShell does not.
I have confirmed, through Task Manager, that both instances are running C:\Program Files\PowerShell\7\pwsh.exe
How do I make them look the same (like under Windows Terminal) and render escape sequences in the stand-alone case?
A bit more madness...
If I take the approach of manually editing the properties of the stand-alone PowerShell to match the settings I see under Windows Terminal it makes an absolute mess. For example, if I set the font to Cascadia Mono 12, which is the setting under Windows Terminal, I get microscopic text that is unusuable:
I have to set the font size to 20 in order to approximate the look of what comes up under Windows Terminal. Also, any changes made to stand-alone PowerShell do not seem to affect PowerShell under Windows Terminal.
EDIT:
This is what Task Manager shows for these two instances. One is PowerShell launched by itself. The other is in the context of Windows Terminal. The latter does not seem to use Console Window Host.
Also, this isn't about legacy Windows PowerShell, which generally lives here:
C:\WINDOWS\system32\WindowsPowerShell\v1.0
This is about modern PowerShell, in this case version 7.2.6, which is installed here:
C:\Program Files\PowerShell\7
Note:
If you launch a console application (such as PowerShell (Core)'s pwsh.exe CLI) directly (either directly by its executable path or via a shortcut file targeting that executable path), you'll invariably (up to Windows 10) / by default (from Windows 11) get a regular (legacy) console window, backed by conhost.exe, the Windows Console Host.
Such windows have their own appearance settings, distinct from Windows Terminal's; the best you can do is to manually match them, as described in the next section.
On Windows 11, you can now configure your system to open console applications with Windows Terminal instead: in the Settings application, search for terminal and select Choose a terminal host app for interactive command-line tools
Alternatively, launch PowerShell via the Windows Terminal CLI, wt.exe, which by definition gives you the desired look and unconditional support for ANSI / VT escape-sequence rendering; e.g.:
wt.exe "C:\Program Files\PowerShell\7\pwsh.exe"
You may alternatively launch with a predefined profile, using the -p option - see this answer for more information.
Note that this invocation method isn't suitable for programmatic use of the PowerShell CLI (in case you want to execute commands unattended and receive their output).
Regular (legacy) console windows (provided by conhost.exe, the Windows Console Host) have their own font and appearance settings, distinct from Windows Terminal's; you can control them via their system menu (click on the icon in the top-left corner of the title bar and select Properties):
You can manually try to emulate the Windows Terminal look, such as by choosing the Cascadia Mono font, and it seems that size 20(!) is required to get the same on-screen size as the size 12 reported via Windows Terminal's settings. However, even then it looks like the font rendering differs slightly. You may also have to tweak the colors to match.
Note that for conhost.exe windows launched via a shortcut file (*.lnk), such as via the Start Menu and the taskbar, any modifications are saved in that shortcut file only.
Thus, to change the settings for an executable launched by direct invocation of the executable path, be sure to launch a session that way before making modifications, e.g. via the Run dialog (WinKey-R).
The modified settings are stored in the registry at [HKEY_CURRENT_USER\Console\<transformed-exe-path>], where <transformed-exe-path> is the full path of the executable with \ characters replaced with _, e.g.
HKEY_CURRENT_USER\Console\C:_Program Files_PowerShell_7_pwsh.exe
As for unconditionally rendering VT / ANSI escape sequences in conhost.exe windows: you can activate support for them in all future conhost.exe windows via the registry, by submitting Set-ItemProperty HKCU:\Console VirtualTerminalLevel -Type DWORD 1, as discussed in more detail in this answer.
How to execute a copy paste operation from Windows 10 to the Bash on Ubuntu on Windows environment?
I tried the following:
ctrl + shift + v
right click to paste
Any suggestions?
Update 2019/04/16: It seems copy/paste is now officially supported in Windows build >= 17643. Take a look at Rich Turner's answer. This can be enabled through the same settings menu described below by clicking the checkbox next to "Use Ctrl+Shift+C/V as Copy/Paste".
Another solution would be to enable "QuickEdit Mode" and then you can paste by right-clicking in the terminal.
To enable QuickEdit Mode, right-click on the toolbar (or simply click on the icon in the upper left corner), select Properties, and in the Options tab, click the checkbox next to QuickEdit Mode.
With this mode enabled, you can also copy text in the terminal by clicking and dragging. Once a selection is made, you can press Enter or right-click to copy.
To get right-click to paste to work:
Right-click on the title bar > Properties
Options tab > Edit options > enable QuickEdit Mode
At long last, we're excited to announce that we FINALLY implemented copy and paste support for Linux/WSL instances in Windows Console via CTRL + SHIFT + [C|V]!
You can enable/disable this feature in case you find a keyboard collision with a command-line app, but this should start working when you install and run any Win10 builds >= 17643. Select "Properties" from the menu to access the following dialog box.
Thanks for your patience while we re-engineered Console's internals to allow this feature to work :)
You can use AutoHotkey (third party application), the command below is good with plain alphanumeric text, however some other characters like =^"%#! are mistyped in console like bash or cmd. (In any non-console window this command works fine with all characters.)
^+v::SendRaw %clipboard%
Right-click the title bar, select context menu Edit -> Paste (until they fix the control key shortcuts)
As others have said, there is now an option for Ctrl+Shf+Vfor paste in Windows 10 Insider build #17643.
Unfortunately this isn't in my muscle memory and as a user of TTY terminals I'd like to use Shf+Ins as I do on all the Linux boxes I connect to.
This is possible on Windows 10 if you install ConEmu which wraps the terminal in a new GUI and allows Shf+Ins for paste. It also allows you to tweak the behaviour in the Properties.
The Console looks like this:
Copy options:
Paste options:
Shf+Ins works out of the box. I can't remember if you need to configure bash as one of the shells it uses but if you do, here is the task properties to add it:
Also allows tabbed Consoles (including different types, cmd.exe, powershell etc). I've been using this since early Windows 7 and in those days it made the command line on Windows usable!
Like it has been written before:
Right Click on Bash on Ubuntu on Windows Icon if you have it on a Task Bar Shortcut Icon
Click on Properties
Select Options Tab on the Properties Window
Check the QuickEditMode option
Click Apply
Now you are able to open a new Bash Terminal and just use Right-Click to paste
In order to be able to copy from Terminal, Just use CTRL+M and this will enable you to select and copy selected Text.
For pasting into Vim in the terminal (bash on ubuntu on windows):
export DISPLAY=localhost:0.0
Not sure how to copy from Vim though :-(
Alternate solution over here, my windows home version Windows Subsystem Linux terminal doesn't have the property to use Shift+Ctrl (C|V)
Use an actual linux terminal]1
Install an X-server in Windows (like X-Ming)
sudo apt install <your_favorite_terminal>
export DISPLAY=:0
fire your terminal app, I tested with xfce4-terminal and gnome-terminal
windows #ubuntu #development
For just copying (possibly long) texts to the Windows clipboard, I have found that just piping the output to clip.exe (including the .exe file extension) works fine for me. So:
$ echo "Hello World" | clip.exe
lets me paste Hello World using Ctrl-V anywhere else.
Now that I have posted this, I notice that related question Pipe from clipboard in linux subsytem for windows includes this and a command solution for pasting from the Windows clipboard as well.
you might have bash but it is still a windows window manager. Highlite some text in the bash terminal window. Right click on the title bar, select "Edit", select "Copy", Now Right Click again on the Title bar, select "Edit" , Select "Paste", Done. You should be able to Highlite text, hit "Enter" then Control V but this seems to be broken
For autohotkey users, a full answer is:
#IfWinActive ahk_class ConsoleWindowClass
^+v::SendInput %clipboard%
Which checks that you're in a console (windows or ubuntu) before pasting from the windows clipboard.
That turned out to be pretty simple. I've got it occasionally. To paste a text you simply need to right mouse button click anywhere in terminal window.
My current use of iTerm is the following everytime:
- Open up
- cd into my project folder
- open up another tab
- cd into my project folder
- Grunt Watch
- open up another tab
- SSH into live server
This is getting a bit tedious now, is there a simple way to make a one click for all of this to be done? I remember back in the windows days you could create custom command prompt files so it would open up and you could just double click it like an app.
Is there anyway I can do this? I have looked at the profiles and I don't think I can do what I am after with that.
Just need pointing in the right direction.
If you're using iTerm2, there is a feature called Arrangements (see the last entry on the page). With this, you can set iTerm to open a series of profiles (which can be set to run a command at startup, start in a specific directory, run a certain shell, etc.).
It seems that creating one profile for working in a directory, a second for the Grunt Watch, and a third to SSH should be trivial, and once the arrangement is saved, it can be recalled with the press of a hotkey (Cmd⇧R on my install). You can also set this to save split-pane windows if you don't want a separate window for each of these tasks.
I've been playing around with a Windows 7 virtual machine and found that by changing the shell registry value in HKLM\Software\Microsoft\Windows NT\CurrentVersion\Winlogon\shell I can use an arbitrary program (for example, paint) as the shell instead of explorer.
Now, given that I have no access to the tools afforded by explorer, how would I go about reverting this? This seems like a rather useful trick for demo machines and such, so I would hope that there's a way to revert them when done.
It turns out that keyboard commands (C-S-ESC, C-M-DEL) still work. Surprisingly, windows-r doesn't work. To revert it, open the task manager using C-S-ESC, then click new task, then you can either run explorer to start the gui shell, or regedit to change the default shell.
I'm just meddling with OSX after a few years on Linux. There's a lot that I'm liking, but one thing that's slowing me down is that if I run the 'terminal' command via shortcut/spotlight/quicksilver, it whisks me off to any existing terminal in whatever space already has a terminal instance open.
I regularly like to pop up a terminal, run a quick command and then close it again, all the while staying in whatever desktop space I happen to be on.
...So, how do I do that on Mac?
Cheers...
Go to System Preferences -> Exposé & Spaces -> Spaces and check When switching to an application, switch to...
Download this tool called Visor
It lets you quickly get a tabbed drop down terminal using a hotkey like Ctrl-`.
Insanely convenient for working in the shell.
Try this tool: https://github.com/nmadhok/OpenInTerminal
This is a really handy tool for programmers on Mac as it lets you open the folder directly in Terminal. You can select multiple folders to open them in multiple terminal windows. You can also select files to open the parent directory in Terminal. This application works with Finder as well as without Finder which is a plus!