diff --git a/CHANGELOG.rst b/CHANGELOG.rst index 1fa431d5f..2e6c1ebf3 100644 --- a/CHANGELOG.rst +++ b/CHANGELOG.rst @@ -9,6 +9,7 @@ This release fixes the following regressions identified in 4.1.0: - Stopped printing output that would cause a glitch on old versions of Midnight Commander (:issue:`11869`). - Added a fix for some configurations of Zellij where :kbd:`escape` key processing was delayed (:issue:`11868`). - Fixed a case where the :doc:`web-based configuration tool ` would generate invalid configuration (:issue:`11861`). +- Fixed a case where pasting into ``fish -c read`` would fail with a noisy error (:issue:`11836`). - Fixed a case where upgrading fish would break old versions of fish that were still running. In general, fish still needs to be restarted after it is upgraded, diff --git a/src/builtins/commandline.rs b/src/builtins/commandline.rs index 11c15816c..5b1aa301d 100644 --- a/src/builtins/commandline.rs +++ b/src/builtins/commandline.rs @@ -635,7 +635,7 @@ pub fn commandline(parser: &Parser, streams: &mut IoStreams, args: &mut [&wstr]) transient = parser.libdata().transient_commandline.clone().unwrap(); current_buffer = &transient; current_cursor_pos = transient.len(); - } else if is_interactive_session() { + } else if parser.interactive_initialized.load() || is_interactive_session() { current_buffer = &rstate.text; current_cursor_pos = rstate.cursor_pos; } else { diff --git a/src/builtins/complete.rs b/src/builtins/complete.rs index 6cec441bf..70ab8b5bd 100644 --- a/src/builtins/complete.rs +++ b/src/builtins/complete.rs @@ -458,7 +458,7 @@ pub fn complete(parser: &Parser, streams: &mut IoStreams, argv: &mut [&wstr]) -> None => { // No argument given, try to use the current commandline. let commandline_state = commandline_get_state(true); - if !is_interactive_session() { + if !parser.interactive_initialized.load() && !is_interactive_session() { streams.err.append(cmd); streams .err