+2016-06-21 Pedro Alves <palves@redhat.com>
+
+ * target.c (target_terminal_inferior): Bail out after
+ unregistering input_fd if not on the main UI.
+ (target_terminal_ours): Bail out after registering input_fd if not
+ on the main UI.
+ (target_terminal_ours_for_output): Bail out if not on the main UI.
+
2016-06-21 Pedro Alves <palves@redhat.com>
* event-top.c (restore_ui_cleanup): Make extern.
UI. */
delete_file_handler (ui->input_fd);
+ /* Since we always run the inferior in the main console (unless "set
+ inferior-tty" is in effect), when some UI other than the main one
+ calls target_terminal_inferior/target_terminal_inferior, then we
+ only register/unregister the UI's input from the event loop, but
+ leave the main UI's terminal settings as is. */
+ if (ui != main_ui)
+ return;
+
if (terminal_state == terminal_is_inferior)
return;
UI. */
add_file_handler (ui->input_fd, stdin_event_handler, ui);
+ /* See target_terminal_inferior. */
+ if (ui != main_ui)
+ return;
+
if (terminal_state == terminal_is_ours)
return;
void
target_terminal_ours_for_output (void)
{
+ struct ui *ui = current_ui;
+
+ /* See target_terminal_inferior. */
+ if (ui != main_ui)
+ return;
+
if (terminal_state != terminal_is_inferior)
return;
(*current_target.to_terminal_ours_for_output) (¤t_target);