File tree 1 file changed +3
-2
lines changed
1 file changed +3
-2
lines changed Original file line number Diff line number Diff line change @@ -160,14 +160,15 @@ impl Client<UnixStream> {
160
160
/// Create a new [Client] connected to a unix socket at the given aname under the default
161
161
/// namespace.
162
162
///
163
- /// The default namespace is located in /tmp/ns.$USER.:0 /
163
+ /// The default namespace is located in /tmp/ns.$USER.$DISPLAY /
164
164
pub fn new_unix ( ns : impl Into < String > , aname : impl Into < String > ) -> io:: Result < Self > {
165
165
let ns = ns. into ( ) ;
166
166
let uname = match env:: var ( "USER" ) {
167
167
Ok ( s) => s,
168
168
Err ( _) => return err ( "USER env var not set" ) ,
169
169
} ;
170
- let path = format ! ( "/tmp/ns.{uname}.:0/{ns}" ) ;
170
+ let display = env:: var ( "DISPLAY" ) . unwrap_or ( ":0" . to_string ( ) ) ;
171
+ let path = format ! ( "/tmp/ns.{uname}.{display}/{ns}" ) ;
171
172
172
173
Self :: new_unix_with_explicit_path ( uname, path, aname)
173
174
}
You can’t perform that action at this time.
0 commit comments