Skip to content

Commit ef300fd

Browse files
committed
!squash
1 parent 42b2ccf commit ef300fd

File tree

4 files changed

+20
-20
lines changed

4 files changed

+20
-20
lines changed

poetry.lock

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/tmuxp/workspace/freezer.py

+5-5
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ def freeze(session):
5959
wconf = {
6060
"options": w.show_window_options(),
6161
"window_name": w.name,
62-
"layout": w.layout,
62+
"layout": w.window_layout,
6363
"panes": [],
6464
}
6565
if w.get("window_active", "0") == "1":
@@ -68,21 +68,21 @@ def freeze(session):
6868
# If all panes have same path, set 'start_directory' instead
6969
# of using 'cd' shell commands.
7070
def pane_has_same_path(p):
71-
return w.panes[0].current_path == p.current_path
71+
return w.panes[0].pane_current_path == p.pane_current_path
7272

7373
if all(pane_has_same_path(p) for p in w.panes):
74-
wconf["start_directory"] = w.panes[0].current_path
74+
wconf["start_directory"] = w.panes[0].pane_current_path
7575

7676
for p in w.panes:
7777
pconf = {"shell_command": []}
7878

7979
if "start_directory" not in wconf:
80-
pconf["shell_command"].append("cd " + p.current_path)
80+
pconf["shell_command"].append("cd " + p.pane_current_path)
8181

8282
if p.get("pane_active", "0") == "1":
8383
pconf["focus"] = "true"
8484

85-
current_cmd = p.current_command
85+
current_cmd = p.pane_current_command
8686

8787
def filter_interpretters_and_shells():
8888
return current_cmd.startswith("-") or any(

tests/test_cli.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -195,7 +195,7 @@ def test_load_symlinked_workspace(
195195
assert session.name == "samplesimple"
196196

197197
assert pane is not None
198-
assert pane.current_path == str(realtemp)
198+
assert pane.pane_current_path == str(realtemp)
199199

200200

201201
if t.TYPE_CHECKING:

tests/workspace/test_builder.py

+13-13
Original file line numberDiff line numberDiff line change
@@ -108,11 +108,11 @@ def f():
108108
nonlocal p
109109
p = w.attached_pane
110110
p.server._update_panes()
111-
return p.current_path == pane_path
111+
return p.pane_current_path == pane_path
112112

113113
assert retry_until(f)
114114

115-
assert p.current_path == pane_path
115+
assert p.pane_current_path == pane_path
116116

117117
proc = session.cmd("show-option", "-gv", "base-index")
118118
base_index = int(proc.stdout[0])
@@ -128,11 +128,11 @@ def f():
128128
nonlocal p
129129
p = window3.attached_pane
130130
p.server._update_panes()
131-
return p.current_path == pane_path
131+
return p.pane_current_path == pane_path
132132

133133
assert retry_until(f)
134134

135-
assert p.current_path == pane_path
135+
assert p.pane_current_path == pane_path
136136

137137

138138
@pytest.mark.skip(
@@ -415,7 +415,7 @@ def test_environment_variables_logs(session: Session, caplog: pytest.LogCaptureF
415415
sum(
416416
1
417417
for record in caplog.records
418-
if 'Cannot set environment for new panes and windows.' in record.msg
418+
if "Cannot set environment for new panes and windows." in record.msg
419419
)
420420
# From both_overrides_in_first_pane.
421421
== 1
@@ -443,11 +443,11 @@ def test_automatic_rename_option(session):
443443
for p in builder.iter_create_panes(w, wconf):
444444
w.select_layout("tiled") # fix glitch with pane size
445445
p = p
446-
assert len(session._windows), window_count
446+
assert len(session.windows), window_count
447447
assert isinstance(w, Window)
448448
assert w.show_window_option("automatic-rename") == "on"
449449

450-
assert len(session._windows) == window_count
450+
assert len(session.windows) == window_count
451451

452452
window_count += 1
453453
w.select_layout(wconf["layout"])
@@ -525,7 +525,7 @@ def test_start_directory(session, tmp_path: pathlib.Path):
525525

526526
def f():
527527
p.server._update_panes()
528-
pane_path = p.current_path
528+
pane_path = p.pane_current_path
529529
return path in pane_path or pane_path == path
530530

531531
# handle case with OS X adding /private/ to /tmp/ paths
@@ -576,7 +576,7 @@ def test_start_directory_relative(session, tmp_path: pathlib.Path):
576576
def f():
577577
p.server._update_panes()
578578
# Handle case where directories resolve to /private/ in OSX
579-
pane_path = p.current_path
579+
pane_path = p.pane_current_path
580580
return path in pane_path or pane_path == path
581581

582582
assert retry_until(f)
@@ -651,7 +651,7 @@ def test_pane_order(session):
651651

652652
def f():
653653
p.server._update_panes()
654-
return p.current_path == pane_path
654+
return p.pane_current_path == pane_path
655655

656656
assert retry_until(f)
657657

@@ -1244,7 +1244,7 @@ def test_first_pane_start_directory(session, tmp_path: pathlib.Path):
12441244

12451245
def f():
12461246
p.server._update_panes()
1247-
pane_path = p.current_path
1247+
pane_path = p.pane_current_path
12481248
return path in pane_path or pane_path == path
12491249

12501250
# handle case with OS X adding /private/ to /tmp/ paths
@@ -1268,10 +1268,10 @@ def test_layout_main_horizontal(session):
12681268
main_horizontal_pane, *panes = window.panes
12691269

12701270
def height(p):
1271-
return int(p._info["pane_height"])
1271+
return int(p.pane_height)
12721272

12731273
def width(p):
1274-
return int(p._info["pane_width"])
1274+
return int(p.pane_width)
12751275

12761276
main_horizontal_pane_height = height(main_horizontal_pane)
12771277
pane_heights = [height(pane) for pane in panes]

0 commit comments

Comments
 (0)