11# Solo Screen
22
3- Screen is a terminal emulator written in pure PHP. It powers [ Solo for Laravel] ( https://github.com/soloterm/solo ) and
3+ Screen is a terminal renderer written in pure PHP. It powers [ Solo for Laravel] ( https://github.com/soloterm/solo ) and
44can be used to build rich text-based user interfaces in any PHP application.
55
66> [ !NOTE]
77> Screen is a library intended to be integrated into PHP applications. It is not a standalone terminal application.
88
9- ## About terminal emulators
9+ ## About terminal renderers
1010
11- A terminal emulator is software that replicates the functionality of a classic hardware computer terminal. It processes
12- text input and output along with special control sequences (ANSI escape codes) that control formatting, cursor movement,
13- and other terminal features .
11+ A terminal renderer processes text and ANSI escape sequences to create a virtual representation of terminal output.
12+ Unlike a full terminal emulator, Screen focuses specifically on correctly interpreting and rendering text content with
13+ formatting rather than handling input, interactive sessions, or process management .
1414
15- Terminal emulators interpret these escape sequences to:
15+ Terminal renderers interpret escape sequences to:
1616
17- - Position the cursor
18- - Set text colors and styles (bold, underline, etc.)
19- - Clear parts of the screen
17+ - Track cursor position
18+ - Apply text colors and styles (bold, underline, etc.)
19+ - Manage screen content
2020- Handle special character sets
21- - And much more
21+ - Generate a final rendered output
2222
2323Screen implements this functionality in pure PHP, allowing developers to build terminal user interfaces without relying
2424on external dependencies or native code.
@@ -33,13 +33,14 @@ potentially "break out" of their visual containers and interfere with other part
3333
3434To solve this problem, Screen creates a virtual terminal buffer where:
3535
36- 1 . All ANSI operations (cursor movements, color changes, screen clears) happen safely within an isolated environment
36+ 1 . All ANSI operations (cursor movements, color changes, screen clears) are safely interpreted within an isolated
37+ environment
37382 . The final rendered state is captured after all operations are processed
38393 . Only the final visual output is displayed to the user's terminal
3940
4041This approach provides complete control over how terminal output is rendered, ensuring that complex ANSI operations stay
4142contained within their designated areas. While initially built for Solo, Screen has evolved into a standalone library
42- that can be used in any PHP application requiring terminal emulation .
43+ that can be used in any PHP application requiring terminal rendering .
4344
4445## Features
4546
@@ -107,7 +108,7 @@ Screen uses multiple buffer types to track content and styling:
107108
108109### ANSI processing
109110
110- Screen correctly handles ANSI escape sequences for:
111+ Screen correctly interprets ANSI escape sequences for:
111112
112113- Cursor movement (up, down, left, right, absolute positioning)
113114- Text styling (colors, bold, italic, underline)
@@ -227,11 +228,11 @@ output:
227228
2282291 . The test renders content in a real terminal (iTerm)
2292302 . It captures a screenshot of the terminal output
230- 3 . It runs the same content through the Screen emulator
231- 4 . It captures a screenshot of the emulated output
231+ 3 . It runs the same content through the Screen renderer
232+ 4 . It captures a screenshot of the rendered output
2322335 . It compares the screenshots pixel-by-pixel to ensure accuracy
233234
234- This testing strategy ensures that Screen's emulation accurately matches real terminal behavior, especially for complex
235+ This testing strategy ensures that Screen's rendering accurately matches real terminal behavior, especially for complex
235236scenarios involving:
236237
237238- Multi-byte characters
@@ -249,7 +250,7 @@ To enable screenshots for all tests, use the following command:
249250ENABLE_SCREENSHOT_TESTING=1 composer test
250251```
251252
252- To enable screenshots for only the tests that dont' already have fixtures, use the following command:
253+ To enable screenshots for only the tests that don't already have fixtures, use the following command:
253254
254255``` shell
255256ENABLE_SCREENSHOT_TESTING=2 composer test
@@ -281,4 +282,4 @@ Solo Screen was developed by Aaron Francis. If you like it, please let me know!
281282- Twitter: https://twitter.com/aarondfrancis
282283- Website: https://aaronfrancis.com
283284- YouTube: https://youtube.com/@aarondfrancis
284- - GitHub: https://github.com/aarondfrancis/solo
285+ - GitHub: https://github.com/aarondfrancis
0 commit comments