Skip to content

'qsv lens' doesn't work with .lessfilter #2795

Closed

Description

@wx672

I added qsv lens into my .lessfilter as the following:

    *.csv | *.tsv)
        qsv lens "$1"
        ;;

but when I try less file.csv, the terminal window (I'm using wezterm) stucked in a blank screen until I press 'q' to quit.
I tried csvlens $1 in .lessfilter as well, it gave me the same result (blank screen).

I also tried csvlens --colorful file.csv and qsv lens file.csv directly on the command line. Both works very well with colors. Don't know why they don't work in .lessfilter. The almost full version of my .lessfilter file:

#!/bin/sh

case "$1" in
    *.csv | *.tsv)
        qsv lens "$1"
        ;;
    *.iso)
        isoinfo -l -i "$1"
        ;;
     *)
        # We don't handle this format.
        exit 127
        ;;
esac

# No further processing by lesspipe necessary
exit 0

System info:

  • OS: Debian Sid
  • qsv v5.1.0
  • Term: wezterm v20240203-110809-5046fc22
  • csvlens v0.13.0

Activity

  1. ondohotola commented on Jun 18, 2025

    @ondohotola
    Contributor

    I like csview which (as a specialized tool) has more features than qsv lens and I have it installed on all my machines anyway.

  2. jqnatividad commented on Jun 20, 2025

    @jqnatividad
    Collaborator

    Thanks for the detailed report @wx672 .

    But if I'm not mistaken, .lessfilter will wait for a 0 exit code before proceeding and displaying the contents of the command's stdout.

    And since both qsv lens and csvlens are interactive and won't return an exit code until you quit, you get a blank screen.

    qsv table should work, though its not interactive.

    Closing this for now. Please feel free to open a new issue to follow up.

  3. ondohotola commented on Jun 20, 2025

    @ondohotola
    Contributor

    so maybe try csview -P?

    I have to confess, I occasionally check how many lines the terminal has, compare that to the number of output lines and then switch off -P depending on the outcome :-)-O

  4. locked and limited conversation to collaborators on Jun 20, 2025
  5. converted this issue into a discussion #2799 on Jun 20, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions