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

Hang in VSCode's integrated terminal #142

Closed
kidonng opened this issue May 2, 2021 · 24 comments
Closed

Hang in VSCode's integrated terminal #142

kidonng opened this issue May 2, 2021 · 24 comments
Assignees

Comments

@kidonng
Copy link

kidonng commented May 2, 2021

procs will hang if running in VSCode's integrated terminal, which is powered by xterm.js:

$ procs --debug 
Info: View::new [0.134s]
Info: view.filter [0.000s]
Info: view.adjust [0.000s]

(Hang)

I haven't test other programs that use xterm.js, but given that I don't have such issue with other programs, I guess procs is to blame.

@dalance
Copy link
Owner

dalance commented May 7, 2021

I tried to reproduce it on the following environment, but all cases work fine.

  • Linux / zsh
  • Windows / PowerShell
  • Windows / Command Prompt

Could you provide your environment?

@kidonng
Copy link
Author

kidonng commented May 7, 2021

Sorry, my fault. I'm using the latest VSCode (1.56.0) on macOS 11.4 (20F5055c). This doesn't seem to be related to shell as I get the same result in bash/zsh/fish.
Is there any additional info needed?

@dalance
Copy link
Owner

dalance commented May 7, 2021

Could you try procs --pager disable --theme dark?

@kidonng
Copy link
Author

kidonng commented May 7, 2021

If I disable the pager, it works. 👍

@dalance
Copy link
Owner

dalance commented May 10, 2021

Hmm, How about procs | less -SR?

@kidonng
Copy link
Author

kidonng commented May 10, 2021

No issues.

@dalance
Copy link
Owner

dalance commented May 10, 2021

Could you try the following repository?
https://github.com/dalance/pager-test

$ git clone https://github.com/dalance/pager-test
$ cd pager-test
$ cargo run

If you don't have Rust environment, I'll setup GitHub Actions for macOS binary later.

@kidonng
Copy link
Author

kidonng commented May 10, 2021

You don't have to setup a CI, however I'm outside, will reply in an hour or two.

@kidonng
Copy link
Author

kidonng commented May 10, 2021

The demo runs with no issue:
image

@dalance
Copy link
Owner

dalance commented May 10, 2021

How about the latest commit?
dalance/pager-test@91d2af0

@kidonng
Copy link
Author

kidonng commented May 10, 2021

Looks like the pager no longer works:

image

Screen.Recording.2021-05-10.at.15.17.14.mov

Also worth mentioning, setting LESSCHARSET=utf-8 doesn't help with procs.

@dalance
Copy link
Owner

dalance commented May 10, 2021

Could you try to change less to the absolute path of less like below?

use pager::Pager;

fn main() {
    Pager::with_pager("/usr/bin/less -SR")
        .pager_envs(&["LESSCHARSET=utf-8"])
        .setup();
    println!("Hello, world!");
}

Additionally, removing pager_envs may be helpful to debug.

use pager::Pager;

fn main() {
    Pager::with_pager("less -SR")
        .setup();
    println!("Hello, world!");
}

@kidonng
Copy link
Author

kidonng commented May 10, 2021

Both works (a. /usr/bin/less -SR with LESSCHARSET=utf-8 b. less -SR).

@dalance
Copy link
Owner

dalance commented May 18, 2021

I fixed another bug, and released v0.11.6.
Is there any behaviour changing?

@dalance dalance self-assigned this May 18, 2021
@kidonng
Copy link
Author

kidonng commented May 18, 2021

Same issue.

@dalance
Copy link
Owner

dalance commented May 18, 2021

Please let me reconfirm.
How about the followings?

procs --pager disable
procs --theme dark
procs --pager disable --theme dark

@kidonng
Copy link
Author

kidonng commented May 18, 2021

I guess that's it. As long as I use --theme auto or don't specify --theme, it hangs.

@dalance
Copy link
Owner

dalance commented May 18, 2021

Ok.
Could you try the following repository?
https://github.com/dalance/termbg

$ git clone https://github.com/dalance/termbg
$ cd termbg
$ cargo run

@kidonng
Copy link
Author

kidonng commented May 18, 2021

Check terminal background color
  Term : XtermCompatible
  Color: detection failed Timeout { source: Timeout }
  Theme: detection failed Timeout { source: Timeout }

@dalance
Copy link
Owner

dalance commented May 18, 2021

I tried to fix.
Could you try the latest commit of procs?

00a3be3

@kidonng
Copy link
Author

kidonng commented May 19, 2021

The latest commit works 👍
Is this some kind of issue I can report to VSCode/xterm.js?

@dalance
Copy link
Owner

dalance commented May 19, 2021

Thanks!
This is because VSCode/xterm.js doesn't support background color query by the xterm compatible way.
I think this is not bug, may be feature request.

@kidonng
Copy link
Author

kidonng commented May 19, 2021

Maybe I will open an issue there later. Thanks for your patience and resolving the issue with me!

@kidonng kidonng closed this as completed May 19, 2021
@dalance
Copy link
Owner

dalance commented May 19, 2021

I released v0.11.7.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants