Skip to content
This repository has been archived by the owner on Nov 29, 2022. It is now read-only.

Scrolling up does not apply all Regexes #75

Closed
aaronols opened this issue Oct 10, 2019 · 4 comments
Closed

Scrolling up does not apply all Regexes #75

aaronols opened this issue Oct 10, 2019 · 4 comments
Assignees
Labels
bug Something isn't working

Comments

@aaronols
Copy link

Description

  1. ssh some-server | ct
  2. open log file with less on remote server
  3. find some colorized lines
  4. scroll down until the lines are out of view
  5. scroll back up
  6. Only some regexes are applied again

Scrolling down seems to always apply all regexes correctly while scrolling up fails to apply some of the more complicated ones..
It appears that the regexes applied when scrolling up are only the most simple ones.

Environment

  • Terminal: zsh in tmux on wsltty
  • OS: [Ubuntu 18.04.3 LTS @ WSL @ Win10 1803 build 17134.1039]
  • ChromaTerm: [0.5.1]

Configuration

This happens with the default configuration.
One pattern I observed not to be reapplied when scrolling up in the remote logs is the date Pattern in the format YYYY-MM-DD.
The time pattern was correctly reapplied when scrolling up though.

@hSaria hSaria self-assigned this Oct 10, 2019
@hSaria
Copy link
Owner

hSaria commented Oct 10, 2019

Thanks for raising this.

It seems like less uses the REVERSE LINE FEED (\eM) sequence which ct doesn't currently understand as a movement sequence.

I've only used the Wiki page for ANSI codes as my initial reference for movement sequences, like those that move the cursor around in vim. Clearly, I need to go straight to the standard. Should be finished in a bit.

I wanted to error on the safe side and only put the sequences that I know perform movements which are then used as a separators when processing the input; most programs would just line-buffer and use new-line as a separator, but as that wouldn't work here (need to support interactive programs), I had to separate based on a lot what I consider as "movement" sequences.

Update: less is actually using REVERSE LINE FEED \eM, not to be confused with DELETE LINE \e[M.

@hSaria
Copy link
Owner

hSaria commented Oct 10, 2019

Fixed in 6c1a79f. v0.5.2 will be published soon (tomorrow probably).

@hSaria hSaria closed this as completed Oct 10, 2019
hSaria added a commit that referenced this issue Oct 14, 2019
@aaronols
Copy link
Author

Thank you very much for fixing this too. It works marvellously 👍

@hSaria
Copy link
Owner

hSaria commented Oct 21, 2019 via email

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants