-
Notifications
You must be signed in to change notification settings - Fork 37
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Issue regarding terminal settings on serial port #86
Comments
I dont know, looks like some bit error problems. |
Okay. Well it is a custom yocto based build and also we have a slightly older version of cligen. On another device CLI has been working fine on serial console port as well as over SSH. However when we started on this new device - on serial console line we had issue that any characters typed being echoed back as garbage or any response being sent on CLI was shown as garbage. For this we had to pick the fix: 5eec731 i.e. to change Now the issue of garbage characters when pasting multiple lines at once still persists. |
What strikes me is that if you ignore parity errors and break, it works. This seems like a mismatch of the serial ports - parity, 7/8 bit, and stop bits. I have also seen slight mismatch in speeds cause problems (e.g. 9600 on one end, 9500 on the other). I don't have serial ports to work with right now, but if you could try combinations of IGNBRK and IGNPAR and report back here. On the subject of multi-line pastes: what is your terminal? I have similar problems when copying from a web browser to iTerm on MacOS. I keep thinking I should figure out why... |
Yes, I tested with all 4 combinations and these was weird that these bits are not related to each other and any bit set from them causes issues:
Baud rate seems fine as well. As no issues are seen on bash shell on serial console port. Only in cligen based CLI issues are seen. I checked Terminal I've tested with are multiple - iTerm on MacOS, MobaXTerm on Windows, default GNOME terminal in Oracle Linux, etc. Issue is seen in all of them. Commands I've copied from TextMate but I don't see issues in content being copied as same commands when pasted on a different device console port work fine and also over SSH work fine. I'm confused as well why this is happening. Locally running some regression we have seen no issues in the CLI behavior by keeping these bits off but still not 100% sure as root cause is not known yet. |
Any further update on this, i m also seeing similar behaviour where i m invoking vtysh internal from my C function with cligen and couldnt achieve multiline copy paste work. To me it looks like async issue as we are invoking vtysh internally so cligen command pormpt is not in sync with copy paste. Anyway we can solve it? |
Maybe someone can analyze/experiment with termios settings in https://github.com/clicon/cligen/blob/master/cligen_getline.c for this issue? |
maybe related: I am using iTerm2 (Mac, obviously) and have noted that when I cut and paste something with multiple lines, the shell (zsh and i think bash) does not see it as a series of commands - it does not act on any of them until I hit return and then it acts on all of them. i have pondered this for a while, but this is a minor annoyance and not the blocker it is in cligen. i haven't researched it too much, but i am thinking maybe that paste is sending newlines (0x0a) and the shell is looking for carriage return (0x0d) to terminate command input while interpreting the newlines as command line separators... anyways, it was just a thought... |
In my case do invoke vtysh internally as part of the command, and i see two behaviours here.
Any flag settings we need to do? Any input will be appreciated here |
my problem is how we can make clipboard and cligen in sync, i.e. for some reason if command execution is delayed? is there any way we can make cligen and clipboard or terminal way of accepting multiline command in sync? |
How do I recreate these issues on a regular ubuntu host? |
Hi there,
We have been using cligen for a while and it seems to work nicely when accessed over SSH. However on a new device and directly connecting via a console/serial port we are seeing a weird issue regarding garbage characters being showing up when pasting multiple lines at once.
Say I copy paste these 5 commands/lines at once:
This is how they are received on the CLI launched via Serial port:
i.e. the lines after the 1st one are interpreted as garbage characters.
while on a CLI launched via SSH they are parsed fine:
With some trial & error we found that commenting this line i.e.
resolves the issue on the serial port. Setting either
IGNBRK
orIGNPAR
or both of them brings the issue back but if both are left unset this garbage character issue does not happen.I do not have much idea about terminal settings & termios. Do you know why we need these bits to be set and any repercussions of keeping these bits unset?
Just for reference these are the default terminal settings of serial port i.e. the content of
old_termios
:The text was updated successfully, but these errors were encountered: