godotengine / godotengine/godot
Output does not display prints after push_warning/push_error calls in EditorScript
- Dominant language
- C++
- Stars
- 117k
- Forks
- 26.8k
- PR merge metrics
- PR metrics pending
Description
### Tested versions
- Reproducible in v4.2.1.stable.official [b09f793f5]
### System information
Godot v4.2.1.stable - Linux Mint 21.1 (Vera) - X11 - Vulkan (Forward+) - dedicated AMD Radeon RX 6700 XT (RADV NAVI22) () - 12th Gen Intel(R) Core(TM) i5-12400 (12 Threads)
### Issue description
I am making editor scripts. I use prints in order to display informations in the output. But from the moment a warning (or an error) is raised, the console stops from updating.
### Steps to reproduce
1. Create an EditorScript with this code :
```gdscript
@tool
extends EditorScript
func _run() -> void :
print("1")
print("2")
push_warning("WARNING") # could be push_error instead
print("3")
print("4")
```
2. Right click on the script, then execute it
3. See the console :
```
core/variant/variant_utility.cpp:1091 - WARNING
1
2
```
**The 3 and 4 do not appear in the console. In order to see them, I have to refresh the console by clicking on filter buttons**. Also, I don't know if it is the intended behavior, but the warning appears first, even though it was called after prints.
### Minimal reproduction project (MRP)
[MRP_RefreshOutput.zip](https://github.com/godotengine/godot/files/14450437/MRP_RefreshOutput.zip)
Contributor guide
Research direction
Reproduce the issue with the provided EditorScript and MRP, then inspect the editor Output console handling around push_warning and push_error. Compare message ordering and refresh behavior after the script prints 3 and 4. Done means all output appears without manually toggling console filters and the ordering is understood or corrected.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- cpp
- Domain
- devtools
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 50/100