Repository navigation
Draw the Beam SQL live view's lines in tmux and Cloud Shell - #41657
ahmedabu98 wants to merge 1 commit into
Conversation
There was a problem hiding this comment.
📋 Review Summary
This PR enables the alternate character set (Capability.ena_acs / enacs) when initializing LiveResultView, fixing an issue in tmux, screen, and Cloud Shell where box-drawing characters were rendered as ASCII letters (x, q, n). The change is concise, safe for terminals without the enacs capability, and verified with a unit test.
🔍 General Feedback
- The fix accurately addresses JLine's assumption that the G1 character set is already loaded with DEC Special Graphics when emitting
enter_alt_charset_mode(SO). - In
LiveResultViewTest, the helper methodwraps()has a minor parser assumption about character set selection escape sequences that would be good to update ifwraps()is ever used withscreenortmuxterminal outputs.
💡 Tip: Comment /gemini review on this pull request to trigger a new Gemini code review.
💬 Inline Findings
sdks/java/extensions/sql/jdbc/src/test/java/org/apache/beam/sdk/extensions/sql/jdbc/LiveResultViewTest.java(line 259): 🟢 Low: FYI: SinceCapability.ena_acsis now emitted (which sends\033(B\033)0onscreen/tmuxterminals),wraps()currently only skips 2 characters after\033for(and only 1 character for), which would leave the trailing'0'in\033)0to be counted as a printable character ifwraps()is ever called onscreen/tmuxoutput. Handlingoutput.charAt(i) == ')'alongside'('inwraps()would keep the test helper resilient.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #41657 +/- ##
============================================
- Coverage 59.44% 58.04% -1.40%
+ Complexity 5156 2841 -2315
============================================
Files 1470 1210 -260
Lines 187755 173283 -14472
Branches 3828 2329 -1499
============================================
- Hits 111604 100578 -11026
+ Misses 72746 69994 -2752
+ Partials 3405 2711 -694
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
|
Assigning reviewers: R: @Abacn for label java. Note: If you would like to opt out of this review, comment Available commands:
The PR bot will only process comments in the main thread (not review comments). |
Follow-up to #41408.
In tmux, the live view's table lines show up as letters:
│comes out asxand─asq, so the header readsop x id x item x qtyover a row ofqqqqnqqqq. Cloud Shell runs every terminal in tmux, so it happens there too.tmux and screen draw lines from a second character set, which a program has to load (the
enacscapability) before it switches to it. JLine switches to that set to draw the table but never loads it, so tmux prints the letters it was given. xterm-style terminals don't need the extra step, which is why the view looks right in most terminals.The view now sends
enacswhen it opens. Terminals without the capability skip it.I checked it in tmux 3.6. With the change, an attached client gets
│, and without it, a plainx. A new test checks that the view loads the set before it draws the first line.