~emersion/mrsh-dev

mrsh_populate_env: unset COLUMNS v2 PROPOSED

Drew DeVault: 1
 mrsh_populate_env: unset COLUMNS

 1 files changed, 5 insertions(+), 0 deletions(-)
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/11598/mbox | git am -3
Learn more about email & git
View this thread in the archives

[PATCH v2] mrsh_populate_env: unset COLUMNS Export this patch

This fixes the ls problem.
---
This was brought up a while ago, but forgotten about. POSIX allows us to
unset this, and it fixes some stupid problems with GNU tools. For your
consideration.

 shell/entry.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/shell/entry.c b/shell/entry.c
index 80dcbea..62377ba 100644
--- a/shell/entry.c
+++ b/shell/entry.c
@@ -111,6 +111,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;
}

-- 
2.27.0