Fix: Preserve RFC2217 URLs in SerialPortFinder.find() in "device monitor" (#5226)

Fix: Preserve RFC2217 URLs in SerialPortFinder.find()
Fixes platformio/platformio-core#5225
This commit is contained in:
Youssef Benhammouda
2025-08-09 11:01:33 +01:00
committed by GitHub
parent 31d630b766
commit 8df56dfbb2

View File

@@ -133,6 +133,10 @@ class SerialPortFinder:
def find(self, initial_port=None): def find(self, initial_port=None):
if initial_port: if initial_port:
# Treat any URL (contains '://') as a literal port
if "://" in initial_port:
return initial_port
# Otherwise fall back to existing wildcard logic
if not is_pattern_port(initial_port): if not is_pattern_port(initial_port):
return initial_port return initial_port
return self.match_serial_port(initial_port) return self.match_serial_port(initial_port)