Skip to content
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

Problems with GNU screen #6

Open
lucmp opened this issue Sep 15, 2023 · 2 comments
Open

Problems with GNU screen #6

lucmp opened this issue Sep 15, 2023 · 2 comments

Comments

@lucmp
Copy link

lucmp commented Sep 15, 2023

When I test zrc on the interactive command line, I often have these problems:

  • Backspace takes the cursor back past the prompt, overwriting it.
  • Pasting text is messy in multiple ways.
  • Pressing the UP arrow key causes the past command lines to be printed close to the prompt, with no space separating it as in the normal prompt.

The problem seems to be related to GNU screen. I use the Fish shell in GNU screen and my terminal application is stjerm, which is almost extinct nowadays. But I don't think stjerm is to blame. The same problem is not reproducible on sakura (another terminal application), until I start a GNU screen session in sakura. Then the problems begin again.

I never had any problem with GNU screen and Fish or Bash, so I am guessing Zrc and screen don't get along too well. It's hard to find anyone who still uses stjerm, but GNU screen is very popular so it's probably a good idea to check that. Maybe tmux too, but I never used it so I don't know if it has issues with Zrc (or any other shell for that matter).

@Edd12321
Copy link
Owner

Just as a temporary fix, you can always use another line editor with zrc.

Run make nozledit. This compiles zrc without its custom line editor. Then, install rlwrap instead of launching zrc, launch rlwrap zrc. This lets you use GNU readline, which takes into account many obscure terminal emulators, multiplexers and so on.

The problem is some terminals handle escape sequences differently. Working with termcap is very cumbersome as terminals are still 70s tech at heart, so inconsistencies like this are to be expected. GNU Readline also adds keyboard shortcuts, and is just nicer than the default line editor I wrote, because it's been around for so many years. You could also use this with tclsh, but the experience will just suck a bit more.

@lucmp
Copy link
Author

lucmp commented Sep 15, 2023

rlwrap also messes things up. Not only with zrc, also with tclsh. So no. I'll keep using fish or Tkcon.

Which brings me to another thing, the readline history. I could open another ticket, but why not just mention it here.

In fish, I can do this:

$ for i in (seq 1 5) {
echo $i
}

When I press up and bring that from the history, fish remembers the entire sequence and prints it entirely. rlwrap doesn't. rlwrap will print every line individually as I press up.

At first I thought it was only rlwrap's fault, but then I saw that zrc without rlwrap also fails to bring the entire command sequence, printing one line at a time. Maybe that could be improved in the future?

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

No branches or pull requests

2 participants