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

Formatting lost after build is finished #108

Open
vercas opened this issue Apr 16, 2019 · 14 comments
Open

Formatting lost after build is finished #108

vercas opened this issue Apr 16, 2019 · 14 comments

Comments

@vercas
Copy link

vercas commented Apr 16, 2019

When using Terminus for builds, I can see colored output just fine from the build command (e.g. from GCC) while the build is running, but it's all gone when the build is finished and the text remains plain white.

@randy3k
Copy link
Owner

randy3k commented Apr 16, 2019

could you do some screenshots or provide the build configuration?

@vercas
Copy link
Author

vercas commented Apr 16, 2019

Well, yes, but it seems to be a bit more complicated than what I first explained.
I do the build, I see colored output just fine, then it finishes, and I still see colors and stuff...
Until my buffer/window/whatever suddenly scrolls to the bottom and all the formatting is gone.
After writing all this text here, I went back to Sublime and now the colors are back again!
Now I pressed the Escape key, it took me to the bottom, and colors are gone again... I alt-tabbed back into Sublime after writing this sentence and the colors are back...

This is my build config: https://github.com/vercas/Beelzebub/blob/master/Beelzebub.sublime-project#L63
And I'm attaching a (mostly useless AFAICT) screenshot of colored output whilst building
snapshot40

Is this supposed to happen when pressing the Escape key? Am I just daft enough to randomly press Escape without realizing it? 😟

@randy3k
Copy link
Owner

randy3k commented Apr 16, 2019

That’s odd. (Ya, you are right. That screenshot is useless). Could you turn on the debug settings in Terminus preferences then repeat the Escape thing? Report what you see in the sublime console after the Escape key is hit.

@macowie
Copy link

macowie commented Apr 16, 2019

I've seen this a couple times using "target": "toggle_terminus_panel" for my RSpec build task. I want to say it's usually after the process exits, I haven't a sense of a pattern yet. Rejiggering the window does make the colors come back.

@randy3k
Copy link
Owner

randy3k commented Apr 16, 2019

With this build system, I always get a colored output

	"build_systems":
	[
		{
			"auto_close": false,
			"cmd":
			[
				"bash",
				"-c",
				"echo -e \"\\033[31mHello World\""
			],
			"name": "Hello World",
			"target": "terminus_open",
			"working_dir": "$folder"
		}
	],

@randy3k
Copy link
Owner

randy3k commented Apr 16, 2019

@macowie

toggle_terminus_panel should not be used as a build target, please use terminus_open instead. You just have to specify panel_name if you want to open the terminal in a panel,

@macowie
Copy link

macowie commented Apr 16, 2019

Yes, I had figured that out after I posted. Thanks.

In my case, something is rerunning the build. Focusing or unfocusing the panel seems to trigger it? I can see the process spin up afterwards. The text output doesn't change but the coloring is overwritten. First all white then the new color is overlaid (incorrectly, as the test order is randomised) as the command runs.

image

I guess this two things, do I need to clear the panel myself before a build? And, what would cause the command to rerun?

This is my current build command

{
  "title": "RSpec",
	"cmd": ["bundle", "exec", "rspec"],
	"working_dir": "${project_path:${folder}}",
	"selector": "source.ruby.rspec",
	"target": "terminus_open",
  "panel_name": "RSpec",
  "auto_close": false,
	"variants": [
	    {
	      "name": "Current File",
				"cmd": ["bundle", "exec", "rspec", "$file"],
	    }
	]
}

I only have a few packages installed, Terminus, Origami, and LSP. And I confirm this doesn't happen when using the stock build panel.

@randy3k
Copy link
Owner

randy3k commented Apr 16, 2019

It will be great if someone can come up with a small reproducible example.

@vercas
Copy link
Author

vercas commented Apr 16, 2019

I think @macowie describes the problem - something is re-running the build.
I noticed that build artifacts are missing sometimes when building with Terminus.
image
You can see the odd behaviour... I did a build before each file listing except the one where the directory vanished.
The only reason I can think of why my directory vanished is because the build restarted spuriously - deleting that directory is the first step in the (full) build process.

@vercas
Copy link
Author

vercas commented Apr 17, 2019

Yeah, I can confirm that it does spurious builds.
While typing the previous comment, it decided to rebuild everything.
The reason why only some of the files are missing in some listings in the previous screenshot is because those files take the longest to produce (beelzebub.bin is ~200 object files built with LTO).

When going back to Sublime, still in the Terminus build view, I can see on the bottom left the line and column numbers changing rapidly, climbing up...

@randy3k
Copy link
Owner

randy3k commented Apr 17, 2019

I think I know what's happening now. There is a feature to relaunch the terminal if the process is terminated. The same mechanism must have been triggered in your cases. Obviously, it is only useful for regular shell and is not desired for a build system.

@randy3k
Copy link
Owner

randy3k commented Apr 17, 2019

I have pushed a fix and made a release v0.2.30. It will be available from package control soon.

@vercas
Copy link
Author

vercas commented Apr 17, 2019

Can't reproduce it right now. Will keep using it today to see if I encounter the issue anymore.

@macowie
Copy link

macowie commented Apr 17, 2019

Yes, this fixed it for me. Running a build is working as expected. I also opened a regular shell in a panel and tried various things and it all worked just fine. Thanks!

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

No branches or pull requests

3 participants