[vim/vim] Fixing systemlist() on Windows (PR #18598)

4 views
Skip to first unread message

MiguelBarro

unread,
Oct 18, 2025, 8:56:13 AM (3 days ago) Oct 18
to vim/vim, Subscribed

You can view, comment on, or merge this pull request online at:

  https://github.com/vim/vim/pull/18598

Commit Summary

  • 7e6e104 systemlist() regression testing
  • 07e39fd make systemlist() aware of Windows endlines

File Changes

(2 files)

Patch Links:


Reply to this email directly, view it on GitHub.
You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/pull/18598@github.com>

MiguelBarro

unread,
Oct 18, 2025, 9:14:55 AM (3 days ago) Oct 18
to vim/vim, Push

@MiguelBarro pushed 2 commits.

  • cd609c9 systemlist() regression testing
  • 7ae1c23 make systemlist() aware of Windows endlines


View it on GitHub or unsubscribe.
You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/pull/18598/before/07e39fd463da0b7038ba1ace4971c97f4fb81be1/after/7ae1c23ca684da0fd6edee5a267736d1c69e4afe@github.com>

zeertzjq

unread,
Oct 18, 2025, 9:40:44 AM (3 days ago) Oct 18
to vim/vim, Subscribed
zeertzjq left a comment (vim/vim#18598)

I don't think this makes sense. The documentation clearly says that systemlist() output lines are separately by NL. They aren't separated by CRNL.


Reply to this email directly, view it on GitHub.

You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/pull/18598/c3418442337@github.com>

MiguelBarro

unread,
Oct 18, 2025, 10:39:15 AM (3 days ago) Oct 18
to vim/vim, Subscribed
MiguelBarro left a comment (vim/vim#18598)

I don't think this makes sense. The documentation clearly says that systemlist() output lines are separately by NL. They aren't separated by CRNL.

You are right. This is tricky. The docs on systemlist says:

	Same as |system()|, but returns a |List| with lines (parts of
	output separated by NL) with NULs transformed into NLs.

And this is meant to be crossplatform because the system docs says:

	To make the result more system-independent, the shell output
	is filtered to replace <CR> with <NL> for Macintosh, and
	<CR><NL> with <NL> for DOS-like systems.

and because systemlist works on system output, it should split the command output in lines properly in any platform.
The issue is that system does not follow the claimed behaviour (returns the OS line endings).
This is understandable because:

  • the current system implementation relies on output redirection. Parsing the output to remove <CR><NL> would be an overhead.
  • by keeping the ouput OS friendly we can properly echo the system result.
    Thus, difficult choice. Either:
  • fix system and break backward compatibility (is the ony actually working on Windows).
  • fix systemlist to workaround the system error.


Reply to this email directly, view it on GitHub.

You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/pull/18598/c3418474742@github.com>

Reply all
Reply to author
Forward
0 new messages