Thanks to visit codestin.com
Credit goes to github.com

Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion agent/agent.go
Original file line number Diff line number Diff line change
Expand Up @@ -312,7 +312,7 @@ func (a *agent) init() {
switch magicType {
case agentssh.MagicSessionTypeSSH:
connectionType = proto.Connection_SSH
case agentssh.MagicSessionTypeVSCode:
case agentssh.MagicSessionTypeVSCode, agentssh.MagicSessionTypeCursor, agentssh.MagicSessionTypeWindsurf:
connectionType = proto.Connection_VSCODE
case agentssh.MagicSessionTypeJetBrains:
connectionType = proto.Connection_JETBRAINS
Expand Down
11 changes: 10 additions & 1 deletion agent/agentssh/agentssh.go
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,11 @@ const (
// MagicSessionTypeJetBrains is set in the SSH config by the JetBrains
// extension to identify itself.
MagicSessionTypeJetBrains MagicSessionType = "jetbrains"
// MagicSessionTypeCursor is set in the SSH config by the Cursor extension to identify itself.
MagicSessionTypeCursor MagicSessionType = "cursor"
// MagicSessionTypeWindsurf is set in the SSH config by the Windsurf
// extension to identify itself.
MagicSessionTypeWindsurf MagicSessionType = "windsurf"
)

// BlockedFileTransferCommands contains a list of restricted file transfer commands.
Expand Down Expand Up @@ -320,6 +325,10 @@ func extractMagicSessionType(env []string) (magicType MagicSessionType, rawType
magicType = MagicSessionTypeVSCode
case MagicSessionTypeJetBrains:
magicType = MagicSessionTypeJetBrains
case MagicSessionTypeCursor:
magicType = MagicSessionTypeCursor
case MagicSessionTypeWindsurf:
magicType = MagicSessionTypeWindsurf
case "", MagicSessionTypeSSH:
magicType = MagicSessionTypeSSH
default:
Expand Down Expand Up @@ -416,7 +425,7 @@ func (s *Server) sessionHandler(session ssh.Session) {
reportSession := true

switch magicType {
case MagicSessionTypeVSCode:
case MagicSessionTypeVSCode, MagicSessionTypeCursor, MagicSessionTypeWindsurf:
s.connCountVSCode.Add(1)
defer s.connCountVSCode.Add(-1)
case MagicSessionTypeJetBrains:
Expand Down
2 changes: 2 additions & 0 deletions agent/agentssh/metrics.go
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,8 @@ func magicTypeMetricLabel(magicType MagicSessionType) string {
case MagicSessionTypeVSCode:
case MagicSessionTypeJetBrains:
case MagicSessionTypeSSH:
case MagicSessionTypeCursor:
case MagicSessionTypeWindsurf:
case MagicSessionTypeUnknown:
default:
magicType = MagicSessionTypeUnknown
Expand Down