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

On h.quit() terminal settings are same as when neuron.hoc was imported. #3259

Merged
merged 8 commits into from
Dec 3, 2024
4 changes: 2 additions & 2 deletions src/nrnpython/inithoc.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -222,13 +222,13 @@
static struct termios original_termios;

static void save_original_terminal_settings() {
if (tcgetattr(STDIN_FILENO, &original_termios) == -1) {
if (tcgetattr(STDIN_FILENO, &original_termios) == -1 && isatty(STDIN_FILENO)) {
std::cerr << "Error getting original terminal attributes\n";
nrnhines marked this conversation as resolved.
Show resolved Hide resolved
}
}

static void restore_original_terminal_settings() {
if (tcsetattr(STDIN_FILENO, TCSANOW, &original_termios) == -1) {
if (tcsetattr(STDIN_FILENO, TCSANOW, &original_termios) == -1 && isatty(STDIN_FILENO)) {

Check warning on line 231 in src/nrnpython/inithoc.cpp

View check run for this annotation

Codecov / codecov/patch

src/nrnpython/inithoc.cpp#L231

Added line #L231 was not covered by tests
std::cerr << "Error restoring terminal attributes\n";
}
}
Expand Down
Loading