How to get that terminal button on right click? - terminal

How to get the terminal button on right click on widows?
The btn looks like this
Terminal Btn
On click of that btn, it opens the terminal.
Termianl

Windows Terminal Preview v1.1.1671.0 and later installers put the Windows Terminal in the context menu.
https://github.com/microsoft/terminal/releases/tag/v1.1.1671.0
But if you have an older version, you need to update the Windows Registry.
Create a wterminal.reg text file and put the following code in it and then run it. Also, make sure paths to wt.exe and wt_32.ico files are correct on your system. You can change those paths according to your system.
Windows Registry Editor Version 5.00
[HKEY_CLASSES_ROOT\Directory\Background\shell\wt]
#="Windows terminal here"
"Icon"="%USERPROFILE%\\AppData\\Local\\terminal\\wt_32.ico"
[HKEY_CLASSES_ROOT\Directory\Background\shell\wt\command]
#="%LOCALAPPDATA%\\Microsoft\\WindowsApps\\wt.exe"
Warning: Be careful and make sure you have a backup of the Windows Registry before applying any changes.
Here you can find more information about it: https://github.com/microsoft/terminal/issues/1060#issuecomment-497539461

Related

How to change default app opened from the terminal in windows 11

I tried to run a .sh file in my terminal and accidentally opened it in vscode, now it always opens in vscode even though i want to run it in the terminal itself.
I tried uninstalling vscode so i can get the option to choose again, but that didn't seem to work. I'm too scared to play about with the JSON file incase I mess something up as this is a school project.
Just change the default app for the .sh file type. After that, .sh files won't open by vs code.
To do this in windows 11
Search For Default Apps on start
Scroll to the bottom and click Reset All Default apps
This will reset all the default apps and you can set the defaults again

How to use a specific command in all directories?

Note: I am sorry if I posted this in the wrong stack exchange website. I have seen similar questions on this website. Please correct me if it was wrong.
So I installed VLC into the directory D:\misc\vlc and when I type "vlc" into command prompt, it starts the VLC media player. However, I want to run this "vlc" command in the directory D:\slam\ . However, every time I do that, it says that "'vlc' is not recognized as an internal or external command,
operable program or batch file.".
Is there a way to run the 'vlc' command in any directory?
Any help is appreciated.
You can add the vlc program to the PATH in Windows using the "Edit Environment Variables" dialog. Assuming Windows 10 (though this dialog is present in older versions too), here is how to add a program to the PATH:
Open the Start Search, type in “env”, and choose “Edit the system environment variables”
Click the “Environment Variables…” button.
Under the “System Variables” section (the lower half), find the row with “Path” in the first column, and click edit.
The “Edit environment variable” UI will appear. Here, you can click “New” and type in the new path you want to add. From this screen you can also edit or reorder them.
Dismiss all of the dialogs by choosing “OK”.
Your changes are saved! You will probably need to restart apps for them to pick up the change. Restarting the machine would ensure all apps are run with the PATH change.
In step 4 above, the new path that you will type is the directory containing the vlc program, e.g. "D:\misc". Note that adding this directory will also make any other programs inside of the "misc" directory accessible as well.

How do I change the Git Bash Here terminal from mingw to the standard cmd OR powershell on Windows 10?

I have started to absolutely HATE mingw as I seem to be unable to wrestle the right click option "Git bash here" away from mingw. I cant highlight anything in mingw and I cant copy paste. All I want is for the same functionality that cmd has on windows 10.
As such, how can I change my git bash to use system32/cmd.exe or powershell instead?
I have tried searching the registry, I have tried reinstalling.
You could edit the registry at HKEY_CLASSES_ROOT\Directory\Background\shell\git_shell\command and
HKEY_CLASSES_ROOT\Directory\shell\git_shell\command to point to the shell you prefer, or better yet add your own parallel entries.
The default property on first of these controls the popup menu when you right click on a blank area (background) in a explorer window, and the second when you right click on a folder.
If you are trying to do it from PowerShell, remember you can use provider-paths like REGISTRY::HKEY_CLASSES_ROOT\Directory\shell\git_shell\command with Get-Item and Set-Item. But if it's just a one-off, I'd use RegEdit so you won't have to deal with nested quotes.

Copy Paste in Bash on Ubuntu on Windows

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.

How can I pop up the system property window in windows7

I want to open the system property window to change environment variable in Windows7. I know how to open that window, and used to use that window sometimes before, but today I opened the window as usual, It does not appear. How can I open it?
You should check why that command stopped to work in your environment, meanwhile try with this (from command line or from Run):
rundll32 sysdm.cpl,EditEnvironmentVariables
Also check this: https://msdn.microsoft.com/en-us/library/windows/desktop/cc144191%28v=vs.85%29.aspx

Resources