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

Failed to write to pager: exec: "less": executable file not found in %PATH% #655

Closed
ondrasek opened this issue Jan 24, 2022 · 3 comments
Closed
Assignees
Labels
bug windows Pertaining to Windows OS.

Comments

@ondrasek
Copy link

Whenever I invoke cheat, I get the following error: failed to write to pager: exec: "less": executable file not found in %PATH%.

For example:

$cheat -c -s ssh
failed to write to pager: exec: "less": executable file not found in %PATH%
$cheat -l
failed to write to pager: exec: "less": executable file not found in %PATH%
$cheat ssh
failed to write to pager: exec: "less": executable file not found in %PATH%

My environment:

echo $PSVersionTable

Name                           Value
----                           -----
PSVersion                      7.2.1
PSEdition                      Core
GitCommitId                    7.2.1
OS                             Microsoft Windows 10.0.22000
Platform                       Win32NT
PSCompatibleVersions           {1.0, 2.0, 3.0, 4.0…}
PSRemotingProtocolVersion      2.3
SerializationVersion           1.1.0.1
WSManStackVersion              3.0

Installed via scoop.

@ondrasek ondrasek added the bug label Jan 24, 2022
@ondrasek
Copy link
Author

The default config from cheat --init does contain the pager key. I suggest removing the default pager configuration, using the PAGER env variable, or adjusting the error message to indicate that pager is configured explicitly in the conf.yml file.

@clach04
Copy link

clach04 commented May 17, 2022

Appears to duplicate #571

@chrisallenlane chrisallenlane self-assigned this Jul 4, 2022
@chrisallenlane chrisallenlane added the windows Pertaining to Windows OS. label Jul 4, 2022
@chrisallenlane
Copy link
Member

@ondrasek, thanks for reporting this. I'm going to close this and track this issue along with other Windows-only issues in #665, but I can confirm this behavior.

I believe I have a fix for this working locally. It should ship with the next version of cheat, hopefully later today.

chrisallenlane added a commit to chrisallenlane/cheat that referenced this issue Jul 4, 2022
- Update the default config file to use `more` instead of `less` as the
  default pager, in order to support Windows out-of-the-box. (cheat#655, cheat#665).

- Use `terminal` Chroma formatter (rather than `terminal16m`) in order
  to accommodate less capable terminal emulators like `cmd.exe` by
  default. Similarly, default to `colorize: false` in configs (changed
  from `true`) (cheat#665).

- Comment out default `style` in order to avoid printing ANSI color
  codes into terminals without color support (cheat#665)

- Attempt to intelligently choose a default editor, rather than rely on
  a hard-coded `vim` in the configs. This should make it easier to use
  `cheat` immediately without needing to specify configs. It should also
  improve `cheat`'s Windows compatibility. (cheat#665)
chrisallenlane added a commit that referenced this issue Jul 5, 2022
- Update the default config file to use `more` instead of `less` as the
  default pager, in order to support Windows out-of-the-box. (#655, #665).

- Use `terminal` Chroma formatter (rather than `terminal16m`) in order
  to accommodate less capable terminal emulators like `cmd.exe` by
  default. Similarly, default to `colorize: false` in configs (changed
  from `true`) (#665).

- Comment out default `style` in order to avoid printing ANSI color
  codes into terminals without color support (#665)

- Attempt to intelligently choose a default editor, rather than rely on
  a hard-coded `vim` in the configs. This should make it easier to use
  `cheat` immediately without needing to specify configs. It should also
  improve `cheat`'s Windows compatibility. (#665)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug windows Pertaining to Windows OS.
Projects
None yet
Development

No branches or pull requests

3 participants