Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issue with Less #834

Closed
SonOfDiablo opened this issue Feb 22, 2020 · 8 comments
Closed

Issue with Less #834

SonOfDiablo opened this issue Feb 22, 2020 · 8 comments
Labels

Comments

@SonOfDiablo
Copy link

There seem to be an issue with the version of less provided in the main bucket.

It doesn't correctly grab the foreground color of the terminal.
Here is an issue on the original less repo: gwsw/less#42
(Similar issue on the WindowsTerminal repo: microsoft/terminal#3218 )

However there seem to be a fix in this repo: https://github.com/rivy/less (though it needs to be build first. I have tried this version and it worked for me at least)
There also, supposedly, is a fix in version 553 of less as indicated by this commit: gwsw/less@0e3d155 (However I have not been able to successfully build this version)

Screenshots

Scoop Provided less:

rivy less fix (Red is my default foreground color):

An alternative (temporary) fix for people that doesn't want to build the version of less provided by rivy

Change the content of less.ps1 file in $env:SCOOP\shims to:

$foregroundColor =(get-host).ui.rawui.ForegroundColor.value__
$backgroundColor = (get-host).ui.rawui.BackgroundColor.value__
if (!(Test-Path Variable:PSScriptRoot)) { $PSScriptRoot = Split-Path $MyInvocation.MyCommand.Path -Parent }
$path = join-path "$psscriptroot" "..\apps\less\current\less.exe"
if($myinvocation.expectingInput) { $input | & $path --color=n$foregroundColor.$backgroundColor  @args } else { & $path --color=n$foregroundColor.$backgroundColor  @args }

With all this I just want to ask if it would be possible to supply the rivy version (Or, if possible, version 553) of less as the default with Scoop?

@tssva
Copy link

tssva commented Feb 22, 2020

I have built 553 and it does resolve the issue with the foreground color.

A more immediate issue is that the url used for checkver and autoupdate in the manifest is no longer valid as the domain registration guysalias.tk has expired and the domain has been returned to the registrar.

@SonOfDiablo
Copy link
Author

SonOfDiablo commented Feb 23, 2020

Yea I noticed the domain had expired, but I thought that was covered in this issue: #150 (Under Upstream issues) which is why I didn't mention it.

@tssva would you be able to provide instructions on how to build 553? I would rather use that than the unofficial version I managed to build.

@tssva
Copy link

tssva commented Feb 23, 2020

I didn't notice the inclusion in #150.

I built less using the mingw-w64 compiler. Along with the compiler perl needs to be installed. I installed both using scoop.
scoop install gcc perl

Inside the less source directory build using:

# In a cmd shell
mingw32-make -f Makefile.wng MINGW_ROOT_PATH=%USERPROFILE%\scoop\apps\gcc\current
# In powershell
mingw32-make -f Makefile.wng MINGW_ROOT_PATH=$env:userprofile\scoop\apps\gcc\current

@SonOfDiablo
Copy link
Author

Looks like I was just missing Perl.. Thanks!

@r15ch13
Copy link
Member

r15ch13 commented Feb 23, 2020

Just for the fun of it, here is the appveyor.yml from here: 😁

version: '{build}-{branch}'
image: Visual Studio 2015
clone_depth: 1
environment:
  MINGW_ROOT: C:\mingw-w64\x86_64-8.1.0-posix-seh-rt_v6-rev0\mingw64
  PATH: '%MINGW_ROOT%\bin;%PATH%'
build_script:
- ps: >-
    & "$env:COMSPEC" /c "mingw32-make -f Makefile.wng MINGW_ROOT_PATH=%MINGW_ROOT%"

    $filename = "less-$env:APPVEYOR_REPO_TAG_NAME.7z"

    if(!$APPVEYOR_REPO_TAG) { $filename = "less-$env:APPVEYOR_REPO_BRANCH.7z" }

    7z a $filename *.exe

    Get-ChildItem * -Include *.exe,*.7z | % { $h = Get-FileHash $_; "$($h.Hash.ToLower())  $($_.Name)" } | Set-Content SHA256SUMS
artifacts:
- path: less.exe
- path: lesskey.exe
- path: lessecho.exe
- path: less*.7z
- path: SHA256SUMS

https://ci.appveyor.com/project/r15ch13/less

@jftuga
Copy link
Contributor

jftuga commented May 5, 2020

I have built less version 560 binaries for Windows. I have also documented the complete build process here:

https://github.com/jftuga/less-Windows

@jftuga
Copy link
Contributor

jftuga commented May 6, 2020

I updated my binary version of less tov560 which fixes an issue where colors were not being properly displayed with v557

https://github.com/jftuga/less-Windows

@stale
Copy link

stale bot commented Oct 27, 2021

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the stale label Oct 27, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

5 participants