-
Notifications
You must be signed in to change notification settings - Fork 93
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
Terminal Height and Width Exception #34
Comments
Hi @utsavsomaiya, Is Prompts incorrectly calculating your terminal height? From your screenshot, it looks like you have far more than the minimum 8 lines. If you'd like to fall back to the old prompts, you can add the following to \Laravel\Prompts\Prompt::fallbackWhen(true); If your system has \Laravel\Prompts\Prompt::fallbackWhen(shell_exec('tput lines') < 8); |
Thank you, @jessarcher. I just checked your suggestion, but my concern is not exactly what you suggested. My concern is when the terminal's scrollback lines are set to 6, can we still show the old prompts? This becomes an issue because sometimes I unknowingly start the database seeding in my VS Code terminal and then close it to continue with my work. Later, when I check again, it throws an exception because the terminal closed, and I missed the error. Is there a way to address this? |
And my screenshot is captured by bigger height. So don't worry. It's works fine in my machine. |
I wonder if we can check for requirement when configuring Prompt to Laravel Command and fallback automatically instead of seeing an exception. |
I'm unaware of a way to determine the number of scrollback lines from within the shell or PHP. The default in VS Code is 1000, so I'm curious to know why you've reduced it so drastically? When I set the scrollback lines to 6, the prompts work fine for me in VS Code terminal. It's just the number of visible lines that impact it (i.e. the height), which can be determined in a few ways: tput lines
stty size
echo $LINES # This won't work inside PHP because it's a shell variable not an environment variable
I'm not sure what you mean. How do you unknowingly start database seeding? And how are Prompts involved? I have tried adding a prompt to I can look at making Laravel automatically fall back to Symfony when the terminal is less than 8 lines, but I'd like to understand a bit more about your issue first. |
As I closed my vs code terminal height will be set to the 6 right? Then at that time my databaseseeder is running but So I need no exception but the give me old laravel prompts. And I also put the |
Can I change the color of the font? @jessarcher |
In my tests the terminal height reported to Prompts is whatever height the terminal was before it was closed.
Could you perhaps create a minimal reproduction repo and steps? It sounds like you've customised your database seeder a fair bit. When I test locally with a fresh Laravel installation in a fresh VS Code installation, I can't replicate the issue unless I resize the terminal height to be less than 8 lines.
This should be Prompt::fallbackWhen(true); |
Yeah.. it works. Thanks jess. 😊 Thanks.. It's out of my knowledge. |
can you tell what is the solution please,because the images won't upload |
Laravel Prompts Version
0.1.3
Laravel Version
10.17.0
PHP Version
8.2
Operating System & Version
Linux
Terminal Application
Vs code terminal
Description
May be at this moment can we use old prompts which used in laravel 10.16!!?
Steps To Reproduce
#3
The text was updated successfully, but these errors were encountered: