Comments (4)
I found the --debug
flag in the code for slightly more info:
[debug:/usr/bin/wslview] Showing debug output.
[debug:/usr/bin/wslview] source default setting
[debug:/usr/bin/wslview] /etc/wslu/conf found, sourcing
ERROR: Registry editing has been disabled by your administrator.
[debug:/usr/bin/wslview] distro: debian
[debug:/usr/bin/wslview] lname: https://github.com
[debug:/usr/bin/wslview] WSLVIEW_DEFAULT_ENGINE: powershell
ERROR: Registry editing has been disabled by your administrator.
[debug:/usr/bin/wslview] properfile_full_path:
[debug:/usr/bin/wslview] validating whether if it is a link
[debug:/usr/bin/wslview] It is a link
[debug:/usr/bin/wslview] cmd: "https://github.com"
[debug:/usr/bin/wslview] winps_exec: called with command Start "https://github.com"
ERROR: Registry editing has been disabled by your administrator.
/usr/bin/wslview: line 267: [: : integer expression expected
Parameter format not correct - ""
Cannot find an overload for "GetEncoding" and the argument count: "0".
At line:1 char:59
+ ... ing]::UTF8; [Console]::InputEncoding = [System.Text.Encoding]::GetEnc ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : NotSpecified: (:) [], MethodException
+ FullyQualifiedErrorId : MethodCountCouldNotFindBest
/usr/bin/wslview: line 270: [: : integer expression expected
from wslu.
I've been walking through the code to see what can be done without checking the registry. Looks like the biggest offender is getting the Windows build number. I've found a reliable fallback which I've patched into my installed version, and it's much quieter, but not completely error-free.
build=$("$(interop_prefix)$(sysdrive_prefix)"/Windows/System32/WindowsPowerShell/v1.0/powershell.exe /c "(gcm wsl).Version.Build" | sed -e 's|\r||g')
from wslu.
It also looks like the codepage variable isn't being set which is causing the Powershell errors. This can also be handled by (ironically) calling Powershell as above:
cp=$("$(interop_prefix)$(sysdrive_prefix)"/Windows/System32/WindowsPowerShell/v1.0/powershell.exe /c "Get-ItemPropertyValue HKLM:\SYSTEM\CurrentControlSet\Control\Nls\CodePage -Name OEMCP" | sed -e 's|\r||g')
from wslu.
And with those two patches, I'm not hitting reg.exe
, and thus getting a clean run. Note that I added a couple of debug_echo commands to check that I'm getting the correct build and codepage with these new methods.
wslview --debug "http://github.com"
[debug:/usr/bin/wslview-patch] Showing debug output.
[debug:/usr/bin/wslview-patch] source default setting
[debug:/usr/bin/wslview-patch] /etc/wslu/conf found, sourcing
[debug:/usr/bin/wslview-patch] build: 22621
[debug:/usr/bin/wslview-patch] distro: debian
[debug:/usr/bin/wslview-patch] lname: http://github.com
[debug:/usr/bin/wslview-patch] WSLVIEW_DEFAULT_ENGINE: powershell
[debug:/usr/bin/wslview-patch] build: 22621
[debug:/usr/bin/wslview-patch] properfile_full_path:
[debug:/usr/bin/wslview-patch] validating whether if it is a link
[debug:/usr/bin/wslview-patch] It is a link
[debug:/usr/bin/wslview-patch] cmd: "http://github.com"
[debug:/usr/bin/wslview-patch] winps_exec: called with command Start "http://github.com"
[debug:/usr/bin/wslview-patch] build: 22621
[debug:/usr/bin/wslview-patch] codepage: 850
from wslu.
Related Issues (20)
- Arch keyring package signing key has expired HOT 8
- PGP key for ArchLinux no longer matches install instructions. HOT 1
- [Feature request] Add expections in wslview HOT 1
- wget fails, Certificate not trusted, no known issuer HOT 2
- wslview unable to open links with square bracket
- wslfetch requires sudo HOT 1
- wslupath should not be deprecated
- Document how to get the latest wslu HOT 1
- Inconsistent wslpath output for Windows drives that exist and those that don't exist HOT 2
- USE XDG_CACHE instead of ~/.config/wslu HOT 1
- OpenSUSE Tumbleweed does not set path.
- Syntax error in wslfetch and wslsys HOT 3
- file uri not decoded by wslview HOT 1
- Cannot set property. Property setting is supported only on core types in this language mode. HOT 3
- No Fedora 39 package built for Fedora 39 chroots (in COPR). HOT 1
- Wrong name HOT 1
- Request to be able to install wslu v4.1.1-1 HOT 7
- wslu guesses wrong path HOT 1
- PPA not available for Ubuntu 23.10 Mantic (and 24.04 Noble Numbat) HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from wslu.