Skip to content

shell: Prevent buggy moving zero column behavior#1678

Merged
bakpakin merged 1 commit intojanet-lang:masterfrom
tw4452852:push-swmvxuxkrvsx
Dec 7, 2025
Merged

shell: Prevent buggy moving zero column behavior#1678
bakpakin merged 1 commit intojanet-lang:masterfrom
tw4452852:push-swmvxuxkrvsx

Conversation

@tw4452852
Copy link
Contributor

@tw4452852 tw4452852 commented Dec 3, 2025

According to https://unix.stackexchange.com/a/559331, moving zero column is implemented inconsistently between different terminal emulators.

In order to fix this inconsistency,
we avoid using this escape sequence entirely.

BTW, this fix is ported from janet-lang/spork#262

Change-Id: I73d4252f8472c769f0cf98b6bbdf2b3d6a6a6964

@sogaiu
Copy link
Contributor

sogaiu commented Dec 3, 2025

I thought the changes were working, but when I tried a few times, I noticed some odd behavior (not sure if it's the changes from this PR).

The way I verified was to set the dynamic variable *repl-prompt* to (fn [_] ""), enter an expression, and then type ctrl-a.

Before applying 878cc65 (note that the cursor is not all the way to the left):

before-pr-column-zero

After applying 878cc65:

after-pr-column-zero

Not sure what is going on here...

FWIW:

$ xfce4-terminal --version
xfce4-terminal 1.1.3 (Xfce 4.18)

@tw4452852
Copy link
Contributor Author

tw4452852 commented Dec 3, 2025

I know the reason. Will revise the patch later.

According to https://unix.stackexchange.com/a/559331,
moving zero column is implemented inconsistently between
different terminal emulators.

In order to fix this inconsistency,
we avoid using this escape sequence entirely.

Signed-off-by: Tw <tw19881113@gmail.com>
Change-Id: I73d4252f8472c769f0cf98b6bbdf2b3d6a6a6964
@tw4452852
Copy link
Contributor Author

tw4452852 commented Dec 4, 2025

@sogaiu I've fixed the bug in the previous version and verified on my side. You could give it a double confirm.

@sogaiu
Copy link
Contributor

sogaiu commented Dec 4, 2025

@tw4452852 Tried it a few times and it seems to be working better 👍

6e883b89

@bakpakin bakpakin merged commit efe66f2 into janet-lang:master Dec 7, 2025
13 checks passed
@tw4452852 tw4452852 deleted the push-swmvxuxkrvsx branch December 7, 2025 14:07
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.

3 participants