Skip to content
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

[Bug]: spaces in commands get deleted #2421

Open
rijobro opened this issue Nov 25, 2021 · 18 comments
Open

[Bug]: spaces in commands get deleted #2421

rijobro opened this issue Nov 25, 2021 · 18 comments

Comments

@rijobro
Copy link

rijobro commented Nov 25, 2021

Problem description

spaces in command get randomly deleted, and I'm not sure why.

Steps to reproduce the behavior.

cd ~/Documents (with space)

-bash~/Documents: No such file or directory

If i then click the upwards arrow, the executed command was
cd~/Documents (no space)
So I re-add the space and re-execute:

-bash~/Documents: No such file or directory

This doesn't happen all the time, I'm not sure what triggers it.

What is the expected behavior?

for spaces not to be deleted

System information

  • Termux application version: 0.117
  • Android OS version: 8.0.0
  • Device model: samsung s7 edge
@agnostic-apollo
Copy link
Member

Some program you previously used likely left the terminal in an invalid state. Try long holding terminal -> More -> Reset when it happens.

Running reset or stty sane can be helpful for such similar weird behaviour too.

@rijobro
Copy link
Author

rijobro commented Nov 25, 2021

I tried all 3 solutions, none worked. My termux is a fresh installation so doubt it's from a previous program (I only use it to SSH). Can you re-open the issue?

@agnostic-apollo
Copy link
Member

By previous program I meant, a previous command that you ran in the same terminal. ssh can be a likely cause.

Can be a keyboard issue as well. Check #2385 (comment)

Provide reproducible instructions.

@Grimler91
Copy link
Member

Check if the enforce-char-based-input workaround makes a difference: #686 (comment)

@rijobro
Copy link
Author

rijobro commented Nov 25, 2021

Thanks both for the suggestion. Doesn't seem to solve the issue, but avoiding the ~ character seems to help when on ssh.

@agnostic-apollo
Copy link
Member

Hopefully, you restarted application or reloading settings after setting value. Post output of cat ~/.termux/termux.properties | grep enforce-char-based-input

Also post a video of the bug.

https://f-droid.org/en/packages/com.orpheusdroid.screenrecorder/

@rijobro
Copy link
Author

rijobro commented Nov 25, 2021

~ $ cat .termux/termux.properties
enforce-char-based-input=true

@agnostic-apollo
Copy link
Member

Thanks. But without exact reproducible command samples, the bug cannot be fixed if its a termux app issue.

@Grimler91
Copy link
Member

You can also test installing another keyboard, like hackers keyboard. If it works with that one then we know that issue is with samsung's stock (or do you have a custom rom installed?) keyboard

@bjlockie
Copy link

Press end after you add the space.
Pressing enter in the middle deletes the added space.
Enter at the end of the command works for me.

@Gabby-Paolucci
Copy link

Gabby-Paolucci commented Jan 26, 2022

I'm experiencing the same problem, and hitting end or moving to the end of the line just causes a different problem--it cuts off the last character. I'm able to reproduce the problems. Here's a sample:

Command where the space is missed

~ $ echohello
echohello: command not found

Trying just adding a space between the o and $ and hitting enter immediately but the result is the same command as before

~ $ echohello
echohello: command not found

Trying adding the space and hitting end before enter, and the space is added but now the last character is removed

~ $ echo hell
hel

Trying adding the space and moving the cursor to the end of the line with the arrow keys before hitting enter, same command ran with the final character removed.

~ $ echo hell
hel

Each time I'm trying to correct the command I'm hitting the up arrow to get the original command in the history before trying to fix it.

After further testing I'm realizing this occurs only while using Microsoft SwiftKey Keyboard, not Hacker's Keyboard, Swype, or Gboard. So it does seem to be a problem with speficic keyboards.

@bjlockie
Copy link

bjlockie commented Jan 26, 2022 via email

@Gabby-Paolucci
Copy link

Setting enforce-char-based-input = true in termux.properties seems to have solved the problem for me with SwiftKey.

@SDRausty

This comment was marked as spam.

@SDRausty

This comment was marked as spam.

@kirisakow
Copy link

kirisakow commented Sep 6, 2022

Setting enforce-char-based-input = true in termux.properties seems to have solved the problem for me with SwiftKey.

Same here! Setting enforce-char-based-input = true in termux.properties seems to have solved the problem. And my keyboard app is SwiftKey too.

Also: @agnostic-apollo here's a video to serve as an illustration for the bug and the solution:

https://www.youtube.com/watch?v=wd86sIP7RLY

@agnostic-apollo
Copy link
Member

Same here! My keyboard app is SwiftKey too.

Do you mean setting the property fixed the issue? There might be some additional settings in the app's keyboard settings that could be affecting behaviour.

Also the video is private.

@kirisakow
Copy link

kirisakow commented Sep 7, 2022

Do you mean setting the property fixed the issue?

It has.

There might be some additional settings in the app's keyboard settings that could be affecting behaviour.

It might be.

Also the video is private.

The video is publicly accessible. I double checked just now

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

7 participants