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

Fix broken line break output when running via docker compose v2.2.x #160

Merged
merged 7 commits into from
Apr 4, 2023

Conversation

defunctl
Copy link
Contributor

@defunctl defunctl commented Apr 3, 2023

Since upgrading to the new docker compose binary (running v2.2.2 on my system), line break outputs have been broken when docker compose exec is run. GitHub Issue, work around

Before this bugfix:
image

After this bugfix:
image

I tested it as well with docker-compose, which is running v2.17.2 on my system and this didn't change the output either way, so it seems backwards compatible.

I also tested running with docker compose exec -T but that didn't make a difference either way, with or without the trailing ' </dev/null'.

@defunctl defunctl self-assigned this Apr 3, 2023
@defunctl defunctl added this to the 1.3.3 milestone Apr 3, 2023
@lucatume
Copy link
Contributor

lucatume commented Apr 4, 2023

I'm not sure this fix would be compatible with Windows in an environment like Powershell.
I had no time to test this out, but it should be tested there too.
Slic only requirements are Docker and PHP and it should run on a vanilla Windows terminal.
To handle the Windows env, the fix could check whether the DIRECTORY_SEPARATOR is \ or not.

I've tested this out locally and the fix is introducing issues:

With the fix, with slic debug on:
CleanShot 2023-04-04 at 10 01 54

With current main, with slic debug on:
CleanShot 2023-04-04 at 10 04 42

Do not apply on Windows, do not apply when not running `docker compose`
commands.
@lucatume
Copy link
Contributor

lucatume commented Apr 4, 2023

I've pushed a fix to try and apply the fix more selectively.

@defunctl
Copy link
Contributor Author

defunctl commented Apr 4, 2023

Thanks, I just assumed everyone was using WSL2 these days. Do note that the bug itself is only when running docker compose exec, so commands that ultimately execute inside the container.

Your screenshots are just the docker compose output. I pulled down your changes and the bug is once again there:

slic dc exec slic "ls -al"

image

@defunctl
Copy link
Contributor Author

defunctl commented Apr 4, 2023

@lucatume pushed 3e216d0...c75a0e2

image

Copy link
Contributor

@lucatume lucatume left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tested again and it's all working correctly now.

@lucatume lucatume merged commit b102eee into main Apr 4, 2023
@lucatume lucatume deleted the bugfix/docker-compose-line-breaks branch April 4, 2023 15:21
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

Successfully merging this pull request may close these issues.

2 participants