-
Notifications
You must be signed in to change notification settings - Fork 44
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
Fix major bug (black screen after VT switch) that became prominent in newer Linux kernels #62
Open
hackerb9
wants to merge
18
commits into
uobikiemukot:master
Choose a base branch
from
hackerb9:master
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Conversation
This file contains 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
Previously, if someone entered sixel mode and accidentally didn't exit it, the screen would just appear to be frozen. Nothing could be done other than switch to another terminal to kill yaft. Xterm doesn't have this problem because it turns off sixel mode when the screen clears (user hits ^L) and during a reset. This is easily accomplished by changing the terminfo for yaft to send '\E\\' (end sixel mode).
Short: Set smcup and rmcup to something harmless so that curses doesn't think they're accidentally missing and try to fake an alternate screen. Long: Alternate screen switching is for terminals that need to be in a special mode before they can use cursor motions, like the Tektronix 4025. On modern terminals, it just appears to reset the screen when a program is entered or exited. This can be annoying: ever looked something up with 'w3m' or 'man' and then wanted to type it into the terminal? If your terminal has "alternate screen switching" enabled the text will be cleared when exiting the program and you cannot read it. When using X or Wayland, a person can work around this annoyance by having multiple terminals open at once, one to read, one to type in. But with yaft, we can't do that. Yaft is correct in not defining smcup or rmcup. Theoretically it shouldn't suffer from alternate screen switching problems. Unfortunately, the ncurses library appearsto fake smcup and rmcup calls if they are not defined for the terminal! So, as a workaround, this patch defines smcup and rmcup to be '\r' (ASCII carriage return). This is a harmless character to send as it simply puts the cursor at the beginning of the line. By the way, I refer to this as "titeInhibit", because that is what Xterm calls the feature to disable "alternate screen switching". The termcap codes for initializing and exiting it are "ti" and "te".
Added support for the included neep font which has rather good Unicode coverage (although not of CJK). I only added the 10x20 font as that's the best version. Also, fixed the included terminus font (ter-u16n) which didn't have a proper glyph_builder function before.
Previously, the makefile was using those standard variables in an idiosyncratic way. Normally, one should be able to do something like this: make prefix=/opt/uobikiemukot install Such things didn't work with this makefile. According the GNU Make documentation, a makefile should never set DESTDIR. Only the person doing the install should set it. The prefix variable should be lowercase and default to $(DESTDIR)/usr/local. The mandir variable is also lowercase and should not be rooted from DESTDIR. The Make documentation says it should be based on datarootdir, but that's just $(prefix)/share, so I cut out the middleman. (I've never seen anyone set datarootdir by hand, but people set prefix often.)
Previously it had suggested that people edit the makefile to run mkfont_bdf, but that may be less convenient.
Without this, yaft's screen isn't shown at all. See issue uobikiemukot#40.
since /usr/local/share/terminfo is not actually searched by default.
Use either BSD or GNU tar for .tar.gz files. Use unzip or bsdtar for the profont.zip file.
Also, clean up the /tmp/glyph_builder directory. (Currently done at start instead of end for debugging).
Previously switching away and then back to the virtual terminal that yaft was running on would just show a black screen. Commands could be run and the screen would show up once `exit` was typed. Now the framebuffer is re-activated in the refresh() call.
We are handling it in refresh() now.
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.
The fix was to use the ioctl for FB_ACTIVATE within the refresh() function. Closes #40. Closes #45. I have not tested this on BSD but I do not believe it will cause any issue.
This pull request also includes the small patch I had submitted years ago to fix the problem with yaft getting hung up on DCS strings. Now
clear
and Ctrl+L work as described in #45.I also made some cleanup to glyph_builder.sh so that it works correctly. The 10x20 neep font is included by default. Bsdtar is no longer required.
The terminfo file is now compiled into /etc/terminfo/ instead of /usr/share/terminfo/. GNU/Linux does not seem to check /usr/share/terminfo. (It is possible the terminfo installation directory will depend on the OS and perhaps it would be best to just put a copy in ~/.terminfo/).