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):
8787 if name :
8888 tmux_args += [name ]
8989 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 ]
9191 vars_dict = {}
9292 for t in vars :
9393 if len (t ) == 2 :
Original file line number Diff line number Diff line change @@ -254,6 +254,32 @@ def test_window_options(self):
254254 w .select_layout (wconf ['layout' ])
255255
256256
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+
257283class WindowAutomaticRename (TmuxTestCase ):
258284
259285 yaml_config = """
@@ -869,4 +895,5 @@ def suite():
869895 suite .addTest (unittest .makeSuite (WindowAutomaticRename ))
870896 suite .addTest (unittest .makeSuite (WindowIndexTest ))
871897 suite .addTest (unittest .makeSuite (WindowOptions ))
898+ suite .addTest (unittest .makeSuite (EnvironmentVariables ))
872899 return suite
You can’t perform that action at this time.
0 commit comments