Welcome!

By registering with us, you'll be able to discuss, share and private message with other members of our community.

SignUp Now!

Done Tie-in to Win 10 x64's WSL Windows Subsystem for Linux

From HowToGeek.com re the October 2018 Windows 10 update:

Notepad Supports Linux and Mac Line Endings

ximg_5b04ae9d33758.png.pagespeed.gp+jp+jw+pj+ws+js+rj+rp+rw+ri+cp+md.ic.joX07aSEJa.png



Notepad finally supports UNIX-style end of line (EOL) characters. Specifically, Notepad now supports UNIX/Linux line endings (LF) and Mac line endings (CR.) This means you can take a text file created on Linux or Mac and open it in Notepad—and it will actually look like it’s supposed to! Previously, the file would look all jumbled up, instead.

You can even edit the file in Notepad and save it, and Notepad will automatically use the appropriate line endings the file originally had. Notepad will still create files with the Windows line ending (CRLF) by default. The status bar shows which type of line endings are used for the current file if you enable it by clicking View>Status Bar.


Copy and Paste Keyboard Shortcuts for Bash

ximg_5b03480e94bdd.png.pagespeed.gp+jp+jw+pj+ws+js+rj+rp+rw+ri+cp+md.ic.f6Rz0KYI2l.png



The Windows Subsystem for Linux runs Bash and other command-line Linux shell environments based on Linux distributions like Ubuntu, Fedora, openSUSE, and Debian on Windows. If you use Bash on Windows, you’re getting a feature many people have been asking for: keyboard shortcuts for copy and paste.

You can now right-click a console window’s title bar and select “Properties” to find an option that enables Ctrl+Shift+C and Ctrl+Shift+V for copy and paste. These keyboard shortcuts are disabled by default for compatibility reasons.

These keyboard shortcuts are available in all console environments, but they’re particularly useful in Linux-based shell environments where the Ctrl+C and Ctrl+V shortcuts are mapped to other functions and don’t function like copy and paste.

Launch a Linux Shell From File Explorer

ximg_5b04aa3123a83.png.pagespeed.gp+jp+jw+pj+ws+js+rj+rp+rw+ri+cp+md.ic.kHfDTnYm0E.png



You can now directly launch a Linux shell in a specific folder from File Explorer. To do so, hold down the Shift key, and then right-click a folder inside File Explorer. You’ll see an “Open Linux shell here” option next to the standard “Open PowerShell window here” option.
 
I just noticed this above and think it's worth emphasizing--nothing Linux-specific:

In Win 10 ver 1809 (Oct 2018 update): You can now right-click a console window’s title bar and select “Properties” to find an option that enables Ctrl+Shift+C and Ctrl+Shift+V for copy and paste. These keyboard shortcuts are disabled by default for compatibility reasons.

These keyboard shortcuts are available in all console environments.

============
Unrelated to that, the following keyboard shortcuts were deprecated long ago but usually still work.

copy: Ctrl+Insert
cut: Shift+Delete
paste: Shift+Insert

They can be a huge help when a program disables ctrl-c, ctrl-v and ctrl-x, because many folks don't know they still exist, so they don't disable them.

Dec 2020 update:

And if you're stuck having to run a DOS program (... don't ask ...) and can't use those, these will work:

copy: Alt+Space, e, k
paste: Alt+Space, e, p

There is no "cut", and it can only do a rectangular copy.
 
Last edited:
TCMD - Linux Interoperability Edition might be a better title, since that's how Microsoft describes it and "interoperability" describes the intended functionality a lot better than "access".
 
It probably would be best to have an "alternative licensing" setup. If one license type is used the Linux capabilities aren't active. If you use a different license type it activates the full capabilities.

That would avoid needing two versions and having to reinstall if the user wants to add the Linux capabilities--just change the license. (For an additional charge, probably around $20.)
 
I wish MS would make the interop a lot faster. I use Unix text utilities a lot and while it's nice to have top-quality versions of all of them available via WSL, using them is very slow. Here's a comparison of a (very simple) plugin GREPP, Gnu GREP.EXE (Win32), TPIPE's grep, and WSL grep.

Code:
v:\> timer /q & grepp olset w32tmparams.btm & timer
set key=hklm\system\currentcontrolset\services\w32time\w32tmparams
Timer 1 off: 12:56:52  Elapsed: 0:00:00.02

v:\> timer /q & G:\gnu\grep.exe olset w32tmparams.btm & timer
set key=hklm\system\currentcontrolset\services\w32time\w32tmparams
Timer 1 off: 12:56:54  Elapsed: 0:00:00.16

v:\> timer /q & tpipe /input=w32tmparams.btm /grep=3,0,0,0,0,0,0,0,olset & timer
set key=hklm\system\currentcontrolset\services\w32time\w32tmparams
Timer 1 off: 12:56:56  Elapsed: 0:00:00.36

v:\> timer /q & wsl grep olset w32tmparams.btm & timer
set key=hklm\system\currentcontrolset\services\w32time\w32tmparams
Timer 1 off: 12:56:58  Elapsed: 0:00:00.61

I'd like to time it in a Linux shell. Does Ubuntu have any utility that will let me time the duration of a command?
 
I'm sure it does. As I said earlier in the thread, although I have Ubuntu set up I don't really use it. I primarily use Linux Mint (based on Ubuntu, which is based on Debian) but in GUI mode. The core functionalities are the same in the various versions.

Also keep in mind that all the WSL stuff is still in beta. That's one reason why it doesn't officially support GUI yet.

What happened is that MS partnered with Canonical (makers of Ubuntu) and once that got going the two Linux heavyweights, Red Hat and Novell (Suse), started jumping in because "we can't be left out."

Also, now that MS is a member of the Linux Foundation, they have a lot more input into the development of the Linux kernel, which should help improve WSL.

I suggest you post on the Ubuntu forum: The leading operating system for PCs, IoT devices, servers and the cloud | Ubuntu

www . ubuntu . com
 
Yup, it's called "time" ... built-in to tcsh with a more elaborate one in /usr/bin

That's pretty good. Below, the third observation (0:00:04) is the duration of the command.

Code:
/mnt/c/Apps/workplace> time grep olset /mnt/c/Apps/workplace/w32tmparams.btm
set key=hklm\system\currentcontrolset\services\w32time\w32tmparams
0.000u 0.000s 0:00.04 0.0%      0+0k 0+0io 0pf+0w
 
Not directly on point, but I saw it was announced a few days ago that IBM has agreed to buy Red Hat for $34 billion.

Red Hat is the largest commercial Linux supplier, and IBM is buying them mainly because Red Hat is a large cloud services provider.
 
run a Linux Desktop Environment like Lxde within WSL
That makes little sense. Linux GUI runs in an X server, WSL would be a regular client like anybody else, and there's enough X servers for Windows to support your needs.
 
That makes little sense. Linux GUI runs in an X server, WSL would be a regular client like anybody else, and there's enough X servers for Windows to support your needs.
That's my point -- MS claims they're only doing character-based, not GUI. But the screenshot is me running Lxde under WSL and the link is the details on how to do that.

By the way, the graphic is of WSL ver 1, which is their translate-to-Windows-system-calls approach, not WSL 2, which is a built-in kernel.
 
I wonder if this is some kind of challenge to run X server under WSL itself, or just inability to look around for something better?
Nah ... at this point it's really just a bit of joking. I could have just posted "Here's a link on how to run an LDE under WSL" instead of a screenshot of "unfortunately it's not possible to do this" showing it being done.

The folks at JP Software realize that at some point they're going to have to develop tie-ins to WSL. And regardless of what MS has been saying, at some point WSL is going to have to provide full Linux support, including support for popular Linux desktops.

At this point my posts in this thread are mainly just "current status of WSL development" to help JP gauge when they need to transition from "Hmm ... interesting ... we'll need to keep an eye on this" to "we need to start planning on incorporating this in future TCC versions."
 
Time and again, running desktop apps and providing graphical environment are two separate tasks in Linux.
You can run desktop apps in WSL right now, if you provide an adequate X server on Windows side.
 
Time and again, running desktop apps and providing graphical environment are two separate tasks in Linux.
You can run desktop apps in WSL right now, if you provide an adequate X server on Windows side.
You're ignoring the fact that WSL 1 is not Linux--it is an API that converts calls to the Linux kernel to equivalent Windows system calls. The earliest versions of WSL did not support calls to Windows' graphics drivers. WSL 2 is a full-blown Linux kernel. Since that is still in Windows Preview, JPSoft is waiting.

The graphic I posted shows I'm running an X-Server and the link explains about needing an X-Server to run anything GUI under any version of Linux.

By the way, the computer I run most at home is an Asus Chromebox hacked to run Linux. It can run Ubuntu 14.04, 18.04 and Linux Mint 18.2, which is the one I mainly run. So, yes, I know about X-Server.
 
Back
Top