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

llvm::SMDiagnostic::print breaks GNU readline #1

Open
osandov opened this issue May 30, 2016 · 1 comment
Open

llvm::SMDiagnostic::print breaks GNU readline #1

osandov opened this issue May 30, 2016 · 1 comment

Comments

@osandov
Copy link
Owner

osandov commented May 30, 2016

After printing an LLVM diagnostic message, the REPL doesn't work properly. This is because in asmaseDiagHandler(), we call llvm::SMDiagnostic::print(). This calls through llvm::raw_fd_ostream::has_colors(), llvm::sys::Process::FileDescriptorHasColors(), and finally terminalHasColors(). terminalHasColors() calls the ncurses setupterm() function, which apparently breaks GNU readline. I need to figure out a way to workaround or fix this.

@osandov
Copy link
Owner Author

osandov commented Jul 31, 2016

Interesting that bcc also hit this in iovisor/bcc#615. The problem is actually the set_curterm((struct term *)nullptr). A possible fix for LLVM would be to only call setupterm() if cur_term != nullptr and not do the set_curterm()/del_curterm() dance at all.

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

1 participant