File tree Expand file tree Collapse file tree 2 files changed +28
-1
lines changed Expand file tree Collapse file tree 2 files changed +28
-1
lines changed Original file line number Diff line number Diff line change @@ -87,7 +87,7 @@ def show_environment(self, name=None):
87
87
if name :
88
88
tmux_args += [name ]
89
89
vars = self .cmd (* tmux_args ).stdout
90
- vars = [tuple (item .split ('=' )) for item in vars ]
90
+ vars = [tuple (item .split ('=' , 1 )) for item in vars ]
91
91
vars_dict = {}
92
92
for t in vars :
93
93
if len (t ) == 2 :
Original file line number Diff line number Diff line change @@ -254,6 +254,32 @@ def test_window_options(self):
254
254
w .select_layout (wconf ['layout' ])
255
255
256
256
257
+ class EnvironmentVariables (TmuxTestCase ):
258
+
259
+ yaml_config = """
260
+ session_name: test env vars
261
+ start_directory: '~'
262
+ environment:
263
+ FOO: BAR
264
+ PATH: /tmp
265
+ windows:
266
+ - layout: main-horizontal
267
+ panes:
268
+ - pane
269
+ window_name: editor
270
+ """
271
+
272
+ def test_environment_variables (self ):
273
+ sconfig = kaptan .Kaptan (handler = 'yaml' )
274
+ sconfig = sconfig .import_config (self .yaml_config ).get ()
275
+ sconfig = config .expand (sconfig )
276
+
277
+ builder = WorkspaceBuilder (sconf = sconfig )
278
+ builder .build (self .session )
279
+
280
+ self .assertEqual ('BAR' , self .session .show_environment ('FOO' ))
281
+ self .assertEqual ('/tmp' , self .session .show_environment ('PATH' ))
282
+
257
283
class WindowAutomaticRename (TmuxTestCase ):
258
284
259
285
yaml_config = """
@@ -869,4 +895,5 @@ def suite():
869
895
suite .addTest (unittest .makeSuite (WindowAutomaticRename ))
870
896
suite .addTest (unittest .makeSuite (WindowIndexTest ))
871
897
suite .addTest (unittest .makeSuite (WindowOptions ))
898
+ suite .addTest (unittest .makeSuite (EnvironmentVariables ))
872
899
return suite
You can’t perform that action at this time.
0 commit comments