-
Notifications
You must be signed in to change notification settings - Fork 32
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: terminal corruption when running in iEX (#91)
- Loading branch information
1 parent
cf070e6
commit 07b310f
Showing
4 changed files
with
81 additions
and
14 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -27,3 +27,4 @@ node-*.tar | |
/node_modules/ | ||
package-lock.json | ||
|
||
app |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
// Test various ANSI sequences and terminal control characters | ||
module.exports = { | ||
outputWithANSI: () => { | ||
// Color and formatting | ||
process.stdout.write('\u001b[31mred text\u001b[0m\n'); | ||
process.stdout.write('\u001b[1mbold text\u001b[0m\n'); | ||
|
||
// Cursor movement | ||
process.stdout.write('\u001b[2Amove up\n'); | ||
process.stdout.write('\u001b[2Bmove down\n'); | ||
|
||
// Screen control | ||
process.stdout.write('\u001b[2Jclear screen\n'); | ||
process.stdout.write('\u001b[?25linvisible cursor\n'); | ||
|
||
// Return a clean string to verify protocol handling | ||
return "clean output"; | ||
}, | ||
|
||
// Test function that outputs complex ANSI sequences | ||
complexOutput: () => { | ||
// Nested and compound sequences | ||
process.stdout.write('\u001b[1m\u001b[31m\u001b[4mcomplex formatting\u001b[0m\n'); | ||
|
||
// OSC sequences (window title, etc) | ||
process.stdout.write('\u001b]0;Window Title\u0007'); | ||
|
||
// Alternative screen buffer | ||
process.stdout.write('\u001b[?1049h\u001b[Halternate screen\u001b[?1049l'); | ||
|
||
return "complex test passed"; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters