mrsh_populate_env: unset COLUMNS v1 PROPOSED

Drew DeVault: 1
 mrsh_populate_env: unset COLUMNS

 1 files changed, 5 insertions(+), 0 deletions(-)
readline is a garbage library and I have no interest in relying on it
for almost anything, especially considering the possibility of libedit
being different. But I can totally move the unset to
> This fixes the ls problem
Honestly, I can't even reproduce this bug now, with termite or
alacritty (no local config).

Can you provide reproduction steps?
Export patchset (mbox)
How do I use this?

Copy & paste the following snippet into your terminal to import this patchset into git:

curl -s https://lists.sr.ht/~emersion/mrsh-dev/patches/7891/mbox | git am -3
Learn more about email & git
View this thread in the archives

[PATCH] mrsh_populate_env: unset COLUMNS Export this patch

This fixes the ls problem
 shell/entry.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/shell/entry.c b/shell/entry.c
index 9bbcbfe..e4ed994 100644
--- a/shell/entry.c
+++ b/shell/entry.c
@@ -87,6 +87,11 @@ bool mrsh_populate_env(struct mrsh_state *state, char **environ) {

	mrsh_env_set(state, "OPTIND", "1", MRSH_VAR_ATTRIB_NONE);

	/* POSIX 8.3: If this variable is unset or null, the implementation
	 * determines the number of columns */
	mrsh_env_unset(state, "LINES");
	mrsh_env_unset(state, "COLUMNS");
	return true;

Good catch! However this seems to be set by readline. Maybe there is a
way to prevent readline from setting it? If not, we could only unset it
in frontend/readline.c.