B: Don't munge $DISPLAY in sam's fifo path #729
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
B first attempts to communicate with sam over its named pipe before falling back to the plumber if that named pipe cannot be found. sam's named pipe is placed at a known location which is where B attempts to find it.
This location is defined in src/cmd/samterm/plan9.c:extstart():
Observe that the path is determined by $USER and $DISPLAY.
However, when B is constructing the path of sam's fifo, if it finds $DISPLAY is ":0", it overrides $DISPLAY to be ":0.0".
This means that B uses a different path for the fifo then the location where it was actually created by sam. As a result B cannot find sam's fifo and B falls back to using the plumber for communication. This is an issue if the plumber has not been started:
Note that previously B did not perform this munging - it was added in commit 669250d ("Various fixes.") with the description:
This does not work in the general case so return to using $DISPLAY directly.
Tested on Debian 12 using KDE w/ x11: B is able to communicate with sam even if the plumber is not running.
Signed-off-by: Jordan Niethe [email protected]
It is not clear to me why the :0 vs :0.0 change was required previously. Is this still necessary? We could have B look for both :0 and :0.0 if there are some systems / configurations where this is needed..