So we come back to my original suggestion - Use Windows Terminal, which does provide this capability, albeit with slightly less convenient keybindings since you have to first get into mark-mode with Ctrl+ Shift+ M. Some other text-mode applications have implemented a configurable clipboard option where you could configure (for example), clip.exe to be the clipboard application to receive copied text, but Bash has not done this. There's just no mechanism in place for it to copy to a clipboard. It can run in a pure-console (no clipboard), Windows ( clip.exe), X (where text might be passed to xsel), macOS, and others. That means that it (and its readline) could always assume that you can select and copy text to the clipboard using the keyboard.īash, on the other hand, started out as a pure-console application that could be used without any graphical, windowing system. Keep in mind that Windows PowerShell has pretty much always existed in an environment where there is a known clipboard (the Windows clipboard). So can I configure Bash, the shell, to select words using Ctrl+ Shift+ Left/Right like PowerShell? This is what is happening with your Ctrl+ Shift+ Left/Right keys. If a key isn't handled by the terminal, then the terminal is going to send it on to the text/console application (shell), or more accurately its input handler (or whatever other application is running, such as vim/ nano/etc.). It's possible for other applications to "hook" the keyboard as well. For instance, pressing Ctrl+ Shift+ T in Windows Terminal will open a new tab with the default profile.ġ I'm over-simplifying here. Console Host doesn't handle many keys itself, but Windows Terminal includes a large number of keybindings, most all of which are customizable. Next 1, the keystroke is sent to the application, which is the terminal in your case. If a key is handled by Windows itself, it typically isn't sent to any other application. For instance, pressing Alt+ Tab tells Windows to switch/cycle between open windows/applications. When you press any key in Windows, it has to get processed somewhere:įirst, a key might be handled by Windows itself. So what the heck does this have to do with selecting words?!Īh, we're getting there -). plink.exe provides the SSH client that you can run in a different terminal.pterm.exe provides the terminal functionality without the SSH client.PuTTY is a bit of a hybrid, since it bundles both its terminal and text-mode application (the SSH client) into one. There are quite a few third-party terminals for Windows as well, and even more for Linux. For instance, you can run PowerShell by starting Windows Terminal and launching the PowerShell profile, but just running "PowerShell" from the Start menu will use the older Console Host. It also runs just fine under Windows 10, but not as "default". It's the default terminal starting with new installations of Windows 11 22H2, and can be set as the default in Windows 11 21H2. It's modern, open-source, feature-rich, and customizable - None of which apply to the older Console Host. Windows Terminal is the (fairly) new replacement. The Windows Console Host is the legacy, 25-year old or so terminal that you are likely seeing when running either PowerShell or Ubuntu/WSL. Windows provides two built-in terminals in the latest release: In recent PowerShell releases, it's PSReadline.Ī terminal, on the other hand, is the windowed application inside which your text-mode applications run. This is typically the Linux readline library for Bash in Ubuntu. Inside the shell, there's an input handler for processing the actual keystrokes. PowerShell and Bash (in Ubuntu in WSL) are shells, which are really just specialized text/console-mode applications for interfacing with other text/console-mode applications (such as Linux ls or Windows ipconfig.exe). Once activated, you can then use the Ctrl+( Shift)+ Left/Right keybindings to move and select words.įirst, it's important to understand the difference between the Shell and the Terminal: You can activate mark-mode with Ctrl+ Shift+ M (which is configurable). The latest release of Windows Terminal (1.15) has added support for "Mark mode", which is probably the closest you will get to the functionality you are requesting. In new installations of Windows 11 22H2, it is now the default terminal for PowerShell, CMD, WSL, and any other "console-mode" application. I would recommend upgrading to Windows Terminal, the (relatively) new terminal replacement in Windows.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |