-
-
Notifications
You must be signed in to change notification settings - Fork 163
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
Set $LINES and $COLUMNS #459
Comments
Yeah good idea, I think readline does this, but the Python readline binding we forked doesn't (since Python never did it). Want to try flipping this flag in https://tiswww.case.edu/php/chet/readline/readline.html
|
Oh wait that might not work... we are handling SIGWINCH ourselves :-/ I guess we can do it in Python code. I also filed #460 -- building with other libs would clarify the interface -- i.e. who handles SIGWINCH. Although I guess I'm not opposed to making $LINES and $COLUMNS work only if you're building against GNU readline. |
Actually looking at the source, bash does this itself in It also lets the user overwrite LINES and COLUMNS which as I recently learned from $PWD is fraught with complication ...
The flow is pretty messy:
|
I am not sure I have cycles now to look at this, but if it will let us put some interesting / important program here I could reprioritize it. Which scripts are using it? https://github.com/oilshell/oil/wiki/Shell-Programs-That-Run-Under-OSH |
I haven't found any programs using this in the wild. I came across this because I thought a program was using $COLUMNS but it had just hard-coded the width to 100 columns. |
Hm GNU readline also sets this, but I said bash does above? As usual it seems like there is a lot of fighting over globals ... https://tiswww.case.edu/php/chet/readline/readline.html
I tested OSH and it doesn't have LINES, so are we overriding the default? Or maybe the problem is that the environment variable is set, but it has to be copied into the shell's memory on SIGWINCH! doh yeah I think that's it. bash does this:
|
These are used by shell scripts to adapt their output to the terminal. Bash seems to implement these with
ioctl
directly instead of storing them as variables, see the following strace:Note that these variables are not required by POSIX.
The text was updated successfully, but these errors were encountered: