Skip to content
This repository has been archived by the owner on Nov 29, 2022. It is now read-only.

Prompt isn't visible immediately when using tmux #97

Closed
hSaria opened this issue Jan 14, 2022 · 6 comments
Closed

Prompt isn't visible immediately when using tmux #97

hSaria opened this issue Jan 14, 2022 · 6 comments
Labels
bug Something isn't working

Comments

@hSaria
Copy link
Owner

hSaria commented Jan 14, 2022

ChromaTerm version

v0.9.2

Terminal

iTerm2

What's happening?

Originally posted by @ciscohack in #96 (comment)

When using tmux, the prompt takes longer to become visible again. Below is a demonstration. When using ct zsh, it is responsive, but when using ct tmux, the prompt takes a bit of time to respond.

Screen.Recording.2022-01-14.at.14.44.25.mov

This was tested with a default configuration file.

@hSaria hSaria added the bug Something isn't working label Jan 14, 2022
@hSaria
Copy link
Owner Author

hSaria commented Jan 14, 2022

@ciscohack, can you test the fix by running the code below

patch /usr/local/lib/python3.9/site-packages/chromaterm/__main__.py << EOF
45,47c45,48
< # The start of a control string
< SPLIT_CONTROL_STRINGS = (b'\x1b\x50', b'\x1b\x58', b'\x1b\x5d', b'\x1b\x5e',
<                          b'\x1b\x5f')
---
> # Control strings that have arbitrary lengths
> ANSI_CONTROL_STRINGS_START = (b'\x1b\x50', b'\x1b\x58', b'\x1b\x5d',
>                               b'\x1b\x5e', b'\x1b\x5f')
> ANSI_CONTROL_STRINGS_END = (b'\x07', b'\x1b\x5c')
322,323c323,325
<             # Separator is an incomplete control strings; wait for the rest
<             if data_read and separator.startswith(SPLIT_CONTROL_STRINGS):
---
>             # Separator is an incomplete control string; wait for the rest
>             if data_read and separator.startswith(ANSI_CONTROL_STRINGS_START) \
>                     and not separator.endswith(ANSI_CONTROL_STRINGS_END):
EOF

This issue was related to tmux's use of a special ANSI sequence called Device Control String. When it appeared at the very end of the data, ct was waiting to ensure it was a complete sequence, but it did so without checking if it was already complete or not. The patch above fixes that.

@hSaria hSaria closed this as completed in 0cb5be6 Jan 14, 2022
@hSaria
Copy link
Owner Author

hSaria commented Jan 15, 2022

ChromaTerm v0.9.3 released with a fix for this issue.

@ciscohack
Copy link

ciscohack commented Jan 15, 2022

@hSaria Sorry for delay response. I am travelling so not able to test But issue is not about prompt delay.. issue is about latency while reading logs and search. issue was more adverse on iterm2 app but less on hyperterm. Will test it and update you. Can you include more default regex for basic captures for network.. like all type of Interfaces/ Routing protocol/ ACL and some basic Syslog.. Just to give default flavour of regex install and use then people add their own rule later. just a request upto you

@ciscohack
Copy link

@hSaria I just updated my CT and now everything working flawless. Thanks a lot. you can close the ticket now.

Please consider my suggestion or call it request in your future update of this lovely App.

"Can you include more default regex for basic captures for network.. like all type of Interfaces/ Routing protocol/ ACL and some basic Syslog.. Just to give default flavour of regex install and use then people add their own rule later. just a request upto you."

@hSaria
Copy link
Owner Author

hSaria commented Jan 16, 2022 via email

@ciscohack
Copy link

Sure! Thanks

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants