Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

fix: SSHConfig: check for multiple start/end blocks#510

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
bcpeinhardt merged 8 commits intomainfromcj/config-ssh/handle-malformed
May 23, 2025

Conversation

johnstcn
Copy link
Member

@johnstcnjohnstcn commentedMay 20, 2025
edited
Loading

Relates to#504

What this does:

Ports over the existing checks incoder config-ssh to handle malformed blocks.

Now, if your SSH config is malformed, you will see an error similar to the below upon attempting to connect:

  • If one of the automatically generated blocks is missing a start or end comment, you will see the below error:
    Screenshot 2025-05-21 at 17 15 04

  • If there is more than one block with a given label, you will see the below error:
    Screenshot 2025-05-21 at 17 14 39

In both cases, it will unfortunately be necessary to edit the SSH config and fix the issue manually.

@johnstcnjohnstcn self-assigned thisMay 20, 2025
@johnstcnjohnstcnforce-pushed thecj/config-ssh/handle-malformed branch from09777c5 toeda19a2CompareMay 20, 2025 17:03
Copy link
Member

@code-ashercode-asher left a comment

Choose a reason for hiding this comment

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

Nice find!

Copy link
Member

@mafredrimafredri left a comment

Choose a reason for hiding this comment

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

Small suggestion but otherwise LGTM 👍🏻

count++
pos=haystack.indexOf(needle,pos+needle.length)
}
returncount
Copy link
Member

Choose a reason for hiding this comment

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

I think this could be simplified, like so?

return[...haystack.matchAll(needle)].length

Copy link
MemberAuthor

Choose a reason for hiding this comment

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

It looks way better, butmatchAll wants aRegExp, which meansneedle would need to be properly un-escaped first.

Copy link
Member

Choose a reason for hiding this comment

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

Oh yeah, forgot not all these methods are string | RegExp. That can be simply amended withRegExp.escape(needle).

Copy link
MemberAuthor

Choose a reason for hiding this comment

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

Only available in Node 24 and current version of VSCode is on 23.11.0 if I'm not mistaken 🥲

mafredri reacted with confused emoji
@bcpeinhardt
Copy link
Collaborator

Note to self: add changelog updates in separate PR so we don't force reapproval.

@bcpeinhardtbcpeinhardt merged commit84acd8c intomainMay 23, 2025
2 checks passed
@bcpeinhardtbcpeinhardt deleted the cj/config-ssh/handle-malformed branchMay 23, 2025 00:49
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Reviewers

@mafredrimafredrimafredri approved these changes

@code-ashercode-ashercode-asher approved these changes

@bcpeinhardtbcpeinhardtbcpeinhardt left review comments

Assignees

@johnstcnjohnstcn

Labels
None yet
Projects
None yet
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

4 participants
@johnstcn@bcpeinhardt@mafredri@code-asher

[8]ページ先頭

©2009-2025 Movatter.jp