Skip to content

Conversation

@vadvolo
Copy link
Contributor

@vadvolo vadvolo commented Nov 23, 2025

  • Add StreamerType enum (ssh/telnet) to proto
  • Add streamer_type field to HostParams
  • Update server.go to select SSH or Telnet streamer based on streamer_type
  • Add WithPort option to telnet streamer
  • Update Python SDK with streamer_type support

vadvolo and others added 7 commits November 22, 2025 15:12
- Add StreamerType enum (ssh/telnet) to proto
- Add streamer_type field to HostParams
- Update server.go to select SSH or Telnet streamer based on streamer_type
- Add WithPort option to telnet streamer
- Update Python SDK with streamer_type support

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
- Remove symlink to pkg/server/proto
- Copy proto files directly to gnetclisdk/proto/
- Add __init__.py files for proper package structure
- Update setup.py to use find_packages()

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
- Handle backspace at position 0 without trying to delete previous char
- Add test cases for leading backspaces and pager clearing patterns
- Fixes panic: slice bounds out of range [-1:]
…ption

This commit fixes two issues with telnet pager handling that caused
configuration lines to be corrupted when fetching device configs:

1. **Newline preservation**: The pager pattern `\r\n --More--` was
   consuming the `\r\n` that should separate configuration lines. Now
   we restore the `\r\n` after the pager is answered to prevent lines
   from merging together.

2. **Backspace clearing sequence stripping**: After answering the pager,
   Cisco devices send a sequence of backspaces, spaces, and backspaces
   to clear the "--More--" prompt from the terminal. Since we already
   remove the pager pattern from the buffer, these control sequences
   would incorrectly delete real content. Added stripPagerClearingSequence()
   to detect and remove these clearing patterns.

Example of the issue fixed:
- Before: "description BG_W451-Obrenov no switchport" (truncated & merged)
- After:  "description BG_W451-ObrenovacStocnjak" + "no switchport" (separate lines)

Changes:
- Added stripPagerClearingSequence() function to detect and remove
  backspace clearing patterns (\b{n} + spaces + \b{n})
- Added pagerAnswered flag to track when to strip clearing sequences
- Restore \r\n in pager handling to preserve line breaks
- Added comprehensive tests for pager newline preservation
- Added tests for stripPagerClearingSequence() function

Related to earlier fix for leading backspace handling in parser.go

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant