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

Update yaft terminfo and font #47

Closed
wants to merge 18 commits into from
Closed

Conversation

hackerb9
Copy link

Improved yaft's terminfo for sixel handling plus alternate screen behavior.
Also added a new font, neep, which has good Unicode coverage.
(Default font remains the same.)

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.
@uobikiemukot uobikiemukot self-assigned this Sep 24, 2019
@uobikiemukot uobikiemukot self-requested a review September 24, 2019 19:30
@uobikiemukot
Copy link
Owner

Thank you for this pull request.
I can't test yaft at the moment (my development environment is broken...), please wait a while.

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.
@hackerb9
Copy link
Author

hackerb9 commented Sep 5, 2021

Did you ever get your development environment working again?

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.
@hackerb9
Copy link
Author

hackerb9 commented Feb 5, 2024

Closing this in favor of a newer pull request which bundles this fix.

@hackerb9 hackerb9 closed this Feb 5, 2024
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.

2 participants