midiwala CLI: "malformed address" when port name contains additional ":" (e.g. "Bome Network Virtual:BomeBox: MIDIHUB-1 [1]") #23
Labels
No labels
bug
documentation
duplicate
enhancement
good first issue
help wanted
invalid
question
wontfix
No milestone
No project
No assignees
2 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference: mark/midiminder#23
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Description
When using
midiwala connect|disconnectwith quotedclient:portnames that themselves contain an extra colon in the port part (e.g.player: T-1), the CLI returnsmalformed address …. Using numericclientID:portIDworks, so this appears to be a parsing limitation in the name-based address path.Environment
midiwala/midiminderversion: (can supply exact version if needed)Steps to Reproduce
List ports (note the extra colon in the port part of some names):
Name-based connect where the port name contains an extra colon → fails:
Name-based connect where neither side contains an extra colon inside the port name → works:
ID-based connect for the same “failing” pair → works:
Actual Behavior
Name-based call (with quotes) errors out when the port contains an additional colon:
The same endpoints work via IDs.
Name-based calls without extra colons in the port (e.g.,
Midi Through:Port-0→rtp-zyn1:out-zyn1) work fine.Expected Behavior
:(sincemidiwala -landlist --ports --plainpresent such names) and resolve them toclientID:portIDinternally.Additional Diagnostics / Context
midiwala -l:aconnect -lfor system view:Workarounds
Use numeric
clientID:portID:Or convert human-readable names to IDs in caller code before invoking
midiwala.Hypothesis / Possible Fix
The name parser likely splits on the first colon to get
clientvsport. When the port contains an additional colon (e.g.,player: T-1), the parser rejects it.Potential fixes:
:):client = left,port = right remainder.^(?P<client>[^:]+):(?P<port>.+)$(trim spaces) to allow colons inside the port name.midiwalaitself presents names with embedded colons.Happy to provide full
midiwala -loutput and exact versions if needed, and to test a patched build.Ugh - I'm so sorry I didn't realize this ages ago.
The current design rejects address like
because it seemed to me ambiguous which side the extra colon belonged to. Instead, the parser offers the ability to quote either client or port (or both), so you can have:
or even
I'm assuming this will work just fine in your case.
BUT
I think the real bug here is that
midiwaladoesn't show such clients or ports with quotes around them. I'll fix that.On reflection, I don't think that display should insert quotes if there is a colon in either the client or the port part. Quotes are used in address specifications (both in rule files and on the command line) to mean exact match.
Because of midiminder/midiwala's partial match feature, there is no need to use the unwieldy port names that Bome generates. You can easily identify clients and ports by any unique smaller string:
or even
These work.
It is also the case that quoting the port will work... but remember that the outer-most set of quote on a shell command line belong to the shell, and don't reach midiwala:
This works, but is admittedly annoying to type. Thankfully, the above abbreviated forms work fine.