New function to ensure compatibility with non-standard terminals#515
Closed
mertalpt wants to merge 1 commit intocontainers:masterfrom
mertalpt:terminal-compatibility
Closed
New function to ensure compatibility with non-standard terminals#515mertalpt wants to merge 1 commit intocontainers:masterfrom mertalpt:terminal-compatibility
mertalpt wants to merge 1 commit intocontainers:masterfrom
mertalpt:terminal-compatibility
Conversation
|
Build failed.
|
Member
|
Let's keep the discussion in one place in #505 Either way, the POSIX shell implementation of Toolbox is deprecated. It's fine if you want to keep it updated, but any change has to go into the Go implementation. |
debarshiray
added a commit
to debarshiray/toolbox
that referenced
this pull request
Aug 28, 2020
It tries to loosely mimic ncurses to look up a terminfo entry for the current terminal, as mentioned in the terminfo(5) manual. Unlike ncurses, it doesn't handle TERMINFO_DIRS, though, to avoid parsing an array of directories for the sake of simplicity. Every line of code in this file is part of the interactive shell's start-up sequence, which makes it a trade-off between correctness and speed. Therefore, the purpose of this warning is not to exhaustively catch all possible corner cases, but to serve as a convenience in the majority of cases. Ultimately, if someone is using an exotic terminal set-up, then a missing warning is a minor price to pay in order to not slow things down for the vast majority of users who don't. Based on code written by Mert Alp Taytak: containers#515 containers#505
Member
|
Closing, in favour of #544 |
debarshiray
reviewed
Aug 28, 2020
| fi | ||
| done | ||
|
|
||
| entry_target="/usr/share/terminfo/${TERM:0:1}" |
Member
There was a problem hiding this comment.
Note that this is a Bash-ism, while this file requires POSIX shell.
This file contains hidden or 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
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.
Proposed solution to issue #505 . Maintainers' input is required for some design decisions.
Problem Summary
Terminal capabilities are stored in terminfo databases and used by libraries such as ncurses to give terminal-independent methods of terminal controls.
Default Fedora images pulled by toolbox lack the necessary terminfo entries to support less common terminals that result in unusable shells inside containers. The solution is to provide the terminfo entry of the current terminal described by the TERM environment variable.
Possible Approaches
Implementation Problems
Implementation Commentary
This process adds around 0.2 seconds to the execution time of "toolbox enter" in my somewhat mid-level laptop.