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

External text editor does not open unless Godot quits #24756

Open
Rubonnek opened this issue Jan 4, 2019 · 6 comments
Open

External text editor does not open unless Godot quits #24756

Rubonnek opened this issue Jan 4, 2019 · 6 comments

Comments

@Rubonnek
Copy link
Member

Rubonnek commented Jan 4, 2019

Godot version:

3.2 branch at commit 68013d2

OS/device including version:

Arch Linux x86_64 - gcc (GCC) 8.2.1 20181127

Issue description:

After trying to run the Finite State Machine example in the demos, which currently has faulty GDScript code, I expected my external editor to run but this was not the case. I placed some debugging code in OS_Unix::execute and turns out that the execvp attempt is actually another command:

Attempting to execute: /opt/godot/bin/godot.x11.opt.tools.64 --path /home/wilson/gitrepos/godot-demo-projects/2d/finite_state_machine --remote-debug 127.0.0.1:6007 --allow_focus_steal_pid 1863 --position 320,180 (null)

For some reason, whether the project was not stopped (i.e. if F8 is not pressed) or not, and Godot quits, the next time Godot opens, it attempts to run my external editor:

Attempting to execute: xterm -bg black -fg white -sl 100000 -e vim +"call cursor(0, 0) /home/wilson/gitrepos/godot-demo-projects/2d/finite_state_machine/player/weapon/sword.gd (null)

For some reason I also had to escape that + symbol with a backslash \ in the argument list within the editor.

For what is worth, here's the code I placed right before the execvp call in OS_Unix::execute:

		fprintf(stderr, "Attempting to execute:");
		for (int i = 0; i < args.size(); i++)
			fprintf(stderr, " %s", args[i]);
		fprintf(stderr, "\n");

Steps to reproduce:

  • Change external editor after opening project using godot -e from within the project path
  • Attempt to run Finite State Machine from the official demos (press F5), if the scene runs fine, place some faulty GDScript code.
  • When the faulty GDScript code is detected, the external editor should have opened at the offending line but it doesn't.
  • Close Godot
  • Reopen the project and attempt to run Finite State Machine demo again after opening project using godot -e from within the project path, the external editor still doesn't open after detecting the faulty GDScript code.

Minimal reproduction project:
See the Finite State Machine example in the godot-demo-repository repository at commit eb27a35a2d5212abfc516aa3c8fcb76c907155f0

@Rubonnek Rubonnek changed the title External text editor does not open unless Godot quits while project is running External text editor does not open unless Godot quits Jan 4, 2019
@akien-mga akien-mga added this to the 3.1 milestone Jan 4, 2019
@akien-mga akien-mga modified the milestones: 3.1, 3.2 Jan 26, 2019
@akien-mga
Copy link
Member

Is this still reproducible in the current master branch / latest 3.2 builds?

@akien-mga akien-mga removed this from the 3.2 milestone Jan 9, 2020
@Rubonnek
Copy link
Member Author

Rubonnek commented Jan 9, 2020

I'll test this next week against a master branch build.

@Rubonnek
Copy link
Member Author

I can confirm this is still happening.

Here are the steps of what I did:

cd godot-demo-projects/2d/finite_state_machine
git checkout eb27a35a2d5212abfc516aa3c8fcb76c907155f0
git clean -xdff
git reset --hard

# External editor option was set to ON before launching godot the first time
# Exec Path and Exec flags are empty
godot -e 
# No external editor spawns as expected
# Update Exec Path and Exec Flags with correct external editor values
# Press F5 to attempt to run the game with fault GDScript
# Godot stops project as usual, but the External Editor does not open.
# Clicking on debug messages also do not open the editor -- I expected this to work at the very least
# Stop the game (F8)
# Press Ctrl-Q and exit the editor
godot -e
# Godot launches and spawns the external editor as soon as possible
# Clicking on warnings now opens the external editor like usual

Also the Exec Path and Exec Flags boxes are somewhat glitchy. The text inside them sometimes disappear all of a sudden when copy-pasting the Exec Path and Exec Flags values. I could not find a way to replicate this last small issue consistently.

@Rubonnek
Copy link
Member Author

For what is worth, the {col} and {line} values do not seem to work when I use the following:

Exec Path: uxterm
Exec Flags: -bg black -fg white -sl 100000 -e vim \+"call cursor({line}, {col})" {file}

Here's how the show up in editor_settings-3.tres:

text_editor/external/exec_path = "uxterm"
text_editor/external/exec_flags = "-bg black -fg white -sl 100000 -e vim \\+\"call cursor({line}, {col})\" {file}"

@KoBeWi
Copy link
Member

KoBeWi commented Dec 19, 2020

Can anyone still reproduce this bug in Godot 3.2.3 or any later release?

@Rubonnek
Copy link
Member Author

Rubonnek commented Dec 20, 2020

Can confirm this is still happening in the 3.2 branch at commit 68013d2. After the faulty GDScript code is detected, Godot is still not opening up the external editor. Not even when restarting Godot now. I've updated the steps to reproduce accordingly.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants