feat: read/write command classification + TUI mode toggle#108
Merged
Conversation
Add CommandMode enum (READ/WRITE) to Command interface. 12 commands classified as WRITE: heapdump, heapanalyze, profile, flame, gcrun, vmset, vmlog, jmx, jfr, threaddump, slowlog, ci. All other commands default to READ. TUI changes: - CMD phase shows only READ commands by default - Press 'w' to toggle WRITE commands view - WRITE mode shows yellow warning banner about JVM state modification - Header shows current mode (β READ / β WRITE) - Footer hints guide user to toggle modes Closes #107 Signed-off-by: rlaope <piyrw9754@gmail.com>
TUI rendering: - Scroll region lock (\033[1;Hr) prevents terminal scroll overflow - Autowrap disabled (\033[?7l) prevents line wrapping artifacts - \033[K at end of each row clears ghost characters - \033[J instead of \033[2J reduces full-screen flicker - Proper terminal state restore on exit (scroll region, autowrap) Write command popup: - 'w' shows info-only popup listing write commands with descriptions - Commands NOT executable from popup, just informational guide - "Run: argus <command> <pid>" hint at bottom Additional TUI exclusions: - jfranalyze, gclog, compare, heapanalyze marked supportsTui()=false (require file path input, not suitable for TUI) Signed-off-by: rlaope <piyrw9754@gmail.com>
- Remove \033[J clear, use \033[H + \033[K overwrite (zero flicker) - Raw OutputStream single-write instead of PrintWriter (faster) - Scroll region lock \033[1;Hr prevents scroll overflow - Remove mouse tracking \033[?1000h (caused random text input + blocked copy) - Fix command row padding (W-1 β W alignment) - Disable autowrap \033[?7l, restore on exit - 50ms key poll for better responsiveness - Last row no trailing \n (prevents H+1 scroll) Signed-off-by: rlaope <piyrw9754@gmail.com>
Signed-off-by: rlaope <piyrw9754@gmail.com>
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Command.CommandModeenum (READ/WRITE) added to Command interfacewto toggle WRITE commandsβ READ/β WRITEindicatorUX Flow
w write cmds (heapdump,profile...) ββ nav β execwβ switches to WRITE commands with warning bannerwagain β back to READ commandsCloses #107
Test plan