Skip to content

Fix: Newlines replaced with spaces in botcmd args (#1716)#1717

Merged
sijis merged 3 commits intoerrbotio:masterfrom
zaughon:newline-args
May 21, 2025
Merged

Fix: Newlines replaced with spaces in botcmd args (#1716)#1717
sijis merged 3 commits intoerrbotio:masterfrom
zaughon:newline-args

Conversation

@zaughon
Copy link
Copy Markdown
Contributor

@zaughon zaughon commented Mar 24, 2025

Original issue from #1307 remains fixed, but preserves newlines in the args:

[@CHANGE_ME ➡ @errbot] >>> !hello
[@CHANGE_ME ➡ @errbot] [␍] line 1
[@CHANGE_ME ➡ @errbot] [␍] line 2
[@CHANGE_ME ➡ @errbot] [␍] 
cmd = 'hello'
args = 'line 1\nline 2'
Hello! You said: line 1
line 2

# new lines in the middle of a command also works:

[@CHANGE_ME ➡ @errbot] >>> !this is a
[@CHANGE_ME ➡ @errbot] [␍] very long
[@CHANGE_ME ➡ @errbot] [␍] command
[@CHANGE_ME ➡ @errbot] [␍] 
cmd = 'this_is_a_very_long_command'
args = ''


[@CHANGE_ME ➡ @errbot] >>> !this is a
[@CHANGE_ME ➡ @errbot] [␍] very long
[@CHANGE_ME ➡ @errbot] [␍] command
[@CHANGE_ME ➡ @errbot] [␍] test
[@CHANGE_ME ➡ @errbot] [␍] 
cmd = 'this_is_a_very_long_command'
args = 'test'


[@CHANGE_ME ➡ @errbot] >>> !this is a
[@CHANGE_ME ➡ @errbot] [␍] very long
[@CHANGE_ME ➡ @errbot] [␍] command
[@CHANGE_ME ➡ @errbot] [␍] with a lot
[@CHANGE_ME ➡ @errbot] [␍] of test
[@CHANGE_ME ➡ @errbot] [␍] 
cmd = 'this_is_a_very_long_command'
args = 'with a lot\nof test'

Copy link
Copy Markdown
Contributor

@sijis sijis left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good. We didn't consider this case.

@sijis sijis merged commit fd70e41 into errbotio:master May 21, 2025
5 checks passed
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.

2 participants