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

panic with operation not supported by the terminal while libterm works fine #73

Open
Dushistov opened this issue May 5, 2017 · 3 comments

Comments

@Dushistov
Copy link

syntex project is port of rustc parser to
be able to use it with stable compiler.

It used term crate as replace of https://github.com/rust-lang/rust/tree/master/src/libterm

And we see difference between term and libterm, the same code from:
https://github.com/serde-rs/syntex/blob/master/syntex_errors/src/emitter.rs

cause panic if use term crate (0.4.5) and not panic and works as expected if use libterm.

See

https://github.com/keringar/syntex/commit/7ca0bb2e2dbae42d3983991787857730854336ef
serde-deprecated/syntex#121
rust-lang/rustfmt#1180
serde-deprecated/syntex#120

Any ideas why eshell handled in different ways in libterm and term?

@Stebalien
Copy link
Owner

Are you sure it's panicing inside the term crate? That is, is the call to unwrap inside the term crate? Sometime in the past, we changed the out-of-tree term crate to actually report an error when an unsupported attribute was used instead of just failing quietly (although I'm pretty sure the change was ported to the in-tree term crate).

Could you give me a stack trace?

@Dushistov
Copy link
Author

@Stebalien

Are you sure it's panicing inside the term crate?

No, panic occures inside of syntex_errors analog of rust/src/librustc_errors.

The source of panic because of TerminfoTerminal::apply_cap from term crate
return Err(::Error::NotSupported), while libterm inside rust return Ok(false),

libterm from rust is up to day:

commit a6ab049ed1db09f693df7d33046b3980f56751c1
Merge: 50b9858 3cd7f37
Author: bors bors@rust-lang.org
Date: Fri May 5 03:56:34 2017 +0000

So if for example replace libterm with term for rustc, it also panics.

Any reasons return Err, instead of Ok(false)? With such API, code will be like this:

https://github.com/keringar/syntex/commit/7ca0bb2e2dbae42d3983991787857730854336ef

@Stebalien
Copy link
Owner

Stebalien commented May 9, 2017 via email

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