- if (msg_file != stdout || get_error_routing_to_terminal ())
- dump_message (ds_cstr (&string), get_viewwidth (), 8, msg_file);
+ if (msg_file != stdout || settings_get_error_routing_to_terminal ())
+ dump_message (ds_cstr (&string),
+ isatty (fileno (msg_file)) ? settings_get_viewwidth () : INT_MAX, 8,
+ write_stream, msg_file);
+
+ dump_message (ds_cstr (&string), 78, 0, write_journal, NULL);
+
+ if (settings_get_error_routing_to_listing ())
+ {
+ /* Disable screen output devices, because the error should
+ already have been reported to the screen with the
+ dump_message call above. */
+ outp_enable_device (false, OUTP_DEV_SCREEN);
+ tab_output_text (TAB_LEFT, ds_cstr (&string));
+ outp_enable_device (true, OUTP_DEV_SCREEN);
+ }