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

Not detecting correct last statement #8

google-mac opened this Issue Feb 14, 2019 · 2 comments


None yet
2 participants
Copy link

google-mac commented Feb 14, 2019

This is a smaller issue, but one that requires me to tweak my usage slightly toward how I might use the CLI, which goes against one of the purposes of this package. Great job, by the way!

My issue is that commented lines do not allow the previous line to be output to the right-side display.

I run a statement (let's say a query) and see the output.
I then run another statement and see its result.
I comment out the last statement so I can see the previous one, but now I've hit the bug and cannot see anything.

Sample code:

$newUsers = User::latest()->take(3)->get();

// $allUsers = User::all();

I can just cut the code that causes the bug and then paste it back in once I've seen the result, but this can get bothersome.

Thanks again! 😁


This comment has been minimized.

Copy link

freekmurze commented Feb 15, 2019

I'd accept a PR that fixes this.


This comment has been minimized.

Copy link

google-mac commented Feb 15, 2019

Could this be an issue with Psy/Shell? I'm reading in the /src/Tinker::run() method and I see that the shell instance is being passed to Psy\ExecutionLoopClosure. Following that into the Psy source code, I see that it is cleaning/trimming the code and using array_pop in /src/Shell::popCodeStack(). If I am understanding this correctly, that may be the issue- it should loop that pop until it finds an executable line.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.
You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session.