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

On Windows 11, shell=pwsh/powershell continues breaking ALE lint #4768

Open
wunewww opened this issue May 5, 2024 · 1 comment
Open

On Windows 11, shell=pwsh/powershell continues breaking ALE lint #4768

wunewww opened this issue May 5, 2024 · 1 comment
Labels

Comments

@wunewww
Copy link

wunewww commented May 5, 2024

Information

VIM version

VIM - Vi IMproved 9.1 (2024 Jan 02, compiled Jan  2 2024 23:53:44)
MS-Windows 64-bit console version

Operating System:

Edition	Windows 11 Pro
Version	23H2
Installed on	‎17/‎06/‎2023
OS build	22631.3527
Experience	Windows Feature Experience Pack 1000.22700.1003.0

What went wrong

On Windows 11, Vim 9.1, when set shell=pwsh.exe or set shell=powershell.exe, ale will excute commands in wrong format.

To be specific, I am using vale to lint my markdown file. when set shell=cmd.exe, ale will excute CMD like (excerpted from :ALEInfo)

cmd /s/c "vale --output=JSON  C:\Users\NIUZHA~1\AppData\Local\Temp\VMQ43BA.tmp\README.md"

when set shell=pwsh.exe, it will be

cmd /s/c "''vale'' --output=JSON  ''C:\Users\NIUZHA~1\AppData\Local\Temp\VA2D6D5.tmp\README.md''"

which could not be recognized by cmd.exe.

Similar issue may have been discussed at #2009

Reproducing the bug

  1. On windows 11, vim 9.1, set shell=pwsh.exe, open vim and trigger ale.
  2. :ALEInfo shows above, and (finished - exit code 1)

:ALEInfo

Error log appears at the bottom.

Expand Current Filetype: markdown Available Linters: ['alex', 'cspell', 'languagetool', 'markdownlint', 'marksman', 'mdl', 'proselint', 'redpen', 'remark_lint', 'textlint', 'vale', 'writegood'] Linter Aliases: 'remark_lint' -> ['remark-lint'] 'writegood' -> ['write-good'] Enabled Linters: ['alex', 'cspell', 'languagetool', 'markdownlint', 'marksman', 'mdl', 'proselint', 'redpen', 'remark_lint', 'textlint', 'vale', 'writegood'] Ignored Linters: [] Suggested Fixers: 'dprint' - Pluggable and configurable code formatting platform 'pandoc' - Fix markdown files with pandoc. 'prettier' - Apply prettier to a file. 'remark-lint' - Fix markdown files with remark-lint 'remove_trailing_lines' - Remove all blank lines at the end of a file. 'textlint' - Fix text files with textlint --fix 'trim_whitespace' - Remove all trailing whitespace characters at the end of every line.

Linter Variables:
" Press Space to read :help for a setting
let g:ale_markdown_markdownlint_executable = 'markdownlint'
let g:ale_markdown_markdownlint_options = ''
let g:ale_markdown_marksman_executable = 'marksman'
let g:ale_markdown_mdl_executable = 'mdl'
let g:ale_markdown_mdl_options = ''
let g:ale_markdown_remark_lint_executable = 'remark'
let g:ale_markdown_remark_lint_options = ''
let g:ale_markdown_remark_lint_use_global = 0
let g:ale_markdown_vale_executable = 'vale'
let g:ale_markdown_vale_input_file = '%t'
let g:ale_markdown_vale_options = ''

Global Variables:
" Press Space to read :help for a setting
let g:ale_cache_executable_check_failures = v:null
let g:ale_change_sign_column_color = 0
let g:ale_command_wrapper = ''
let g:ale_completion_delay = 100
let g:ale_completion_enabled = 1
let g:ale_completion_max_suggestions = 50
let g:ale_disable_lsp = 'auto'
let g:ale_echo_cursor = 1
let g:ale_echo_msg_error_str = 'Error'
let g:ale_echo_msg_format = '%code: %%s'
let g:ale_echo_msg_info_str = 'Info'
let g:ale_echo_msg_warning_str = 'Warning'
let g:ale_enabled = 1
let g:ale_fix_on_save = 1
let g:ale_fixers = {'*': ['remove_trailing_lines', 'trim_whitespace']}
let b:ale_fixers = ['pandoc', 'remove_trailing_lines', 'trim_whitespace']
let g:ale_history_enabled = 1
let g:ale_info_default_mode = 'preview'
let g:ale_history_log_output = 1
let g:ale_keep_list_window_open = 0
let g:ale_lint_delay = 200
let g:ale_lint_on_enter = 1
let g:ale_lint_on_filetype_changed = 1
let g:ale_lint_on_insert_leave = 1
let g:ale_lint_on_save = 1
let g:ale_lint_on_text_changed = 'normal'
let g:ale_linter_aliases = {}
let g:ale_linters = {}
let g:ale_linters_explicit = 0
let g:ale_linters_ignore = {}
let g:ale_list_vertical = 0
let g:ale_list_window_size = 10
let g:ale_loclist_msg_format = '%code: %%s'
let g:ale_max_buffer_history_size = 20
let g:ale_max_signs = -1
let g:ale_maximum_file_size = v:null
let g:ale_open_list = 0
let g:ale_pattern_options = v:null
let g:ale_pattern_options_enabled = v:null
let g:ale_root = {}
let g:ale_set_balloons = 0
let g:ale_set_highlights = 1
let g:ale_set_loclist = 1
let g:ale_set_quickfix = 0
let g:ale_set_signs = 1
let g:ale_sign_column_always = 0
let g:ale_sign_error = 'E'
let g:ale_sign_info = 'I'
let g:ale_sign_offset = 1000000
let g:ale_sign_style_error = 'E'
let g:ale_sign_style_warning = 'W'
let g:ale_sign_warning = 'W'
let g:ale_sign_highlight_linenrs = 0
let g:ale_type_map = {}
let g:ale_use_neovim_diagnostics_api = 0
let g:ale_use_global_executables = v:null
let g:ale_virtualtext_cursor = 'all'
let g:ale_warn_about_trailing_blank_lines = 1
let g:ale_warn_about_trailing_whitespace = 1

LSP Error Messages:

(Errors for marksman)
Failed to find project root, language server won't start.
Command History:

(executable check - failure) alex
(executable check - failure) cspell
(executable check - failure) languagetool
(executable check - failure) markdownlint
(executable check - failure) mdl
(executable check - failure) proselint
(executable check - failure) redpen
(executable check - failure) remark
(executable check - failure) textlint
(executable check - success) vale
(finished - exit code 1) 'cmd /s/c "''vale'' --output=JSON ''C:\Users\NIUZHA~1\AppData\Local\Temp\VA2D6D5.tmp\README.md''"'

<<>>

(executable check - failure) write-good

@wunewww wunewww added the bug label May 5, 2024
@wunewww
Copy link
Author

wunewww commented May 6, 2024

currently, I manually set let g:ale_shell='cmd.exe' and let g:ale_shell_arguments='\s\c' to fix this problem. This is in the same with ALE default behavior, there may be some problems with parsing commands on Windows, when set shell=pwsh.exe.

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

No branches or pull requests

1 participant