Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

attempt to get an unknown field 'get_pane_direction' #3141

Closed
distek opened this issue Feb 21, 2023 · 4 comments
Closed

attempt to get an unknown field 'get_pane_direction' #3141

distek opened this issue Feb 21, 2023 · 4 comments
Labels
bug Something isn't working

Comments

@distek
Copy link

distek commented Feb 21, 2023

What Operating System(s) are you seeing this problem on?

Linux X11, Linux Wayland

Which Wayland compositor or X11 Window manager(s) are you using?

> sway --version
sway version 1.8.1

WezTerm version

wezterm 20230219-070657-23211fc8

Did you try the latest nightly build to see if the issue is better (or worse!) than your current version?

Yes, and I updated the version box above to show the version of the nightly that I tried

Describe the bug

Hello!

Setting up some keybindings and ran in to this:

12:18:26.060  WARN   wezterm_gui::termwindow::resize > cannot resize window to match Some(RowsAndCols { rows: 51, cols: 57 }) because window_state is MAXIMIZED
12:18:32.498  ERROR  wezterm_gui::termwindow         > while processing user-defined-4 event: runtime error: attempt to get an unknown field 'get_pane_direction'
stack traceback:
        [C]: in upvalue 'error'
        [string "__mlua_index"]:22: in metamethod 'index'
        /home/distek/.config/wezterm/keybindings.lua:82: in function </home/distek/.config/wezterm/keybindings.lua:81>

when trying to call the following:

	{
		key = "H",
		mods = "ALT|SHIFT",
		action = wezterm.action_callback(function(win, pane)
			wezterm.log_info(pane:get_pane_direction("Left"))
		end),
	},

Is there something I'm doing wrong here? I can clearly see that get_pane_direction is defined in wezterm's source, so I'm not sure what I'm missing.

I also tried with win:get_pane_direction just to be sure.

To Reproduce

  • Use the keybinding snippet above
  • start a new window with wezterm start --always-new-process
  • Press Alt+Shift+H

Configuration

wezterm.lua:

return {
...
	keys = require("keybindings"),
...
}

keybindings.lua:

return {
	{
		key = "H",
		mods = "ALT|SHIFT",
		action = wezterm.action_callback(function(win, pane)
			wezterm.log_info(win:get_pane_direction("Left"))
		end),
	},
}

Expected Behavior

log the pane info in whichever direction

Logs

12:18:26.060 WARN wezterm_gui::termwindow::resize > cannot resize window to match Some(RowsAndCols { rows: 51, cols: 57 }) because window_state is MAXIMIZED
12:18:32.498 ERROR wezterm_gui::termwindow > while processing user-defined-4 event: runtime error: attempt to get an unknown field 'get_pane_direction'
stack traceback:
[C]: in upvalue 'error'
[string "__mlua_index"]:22: in metamethod 'index'
/home/distek/.config/wezterm/keybindings.lua:82: in function </home/distek/.config/wezterm/keybindings.lua:81>

Anything else?

I appreciate the work that's been put in to this. It has very quickly became my favorite terminal emulator!

@distek distek added the bug Something isn't working label Feb 21, 2023
@distek
Copy link
Author

distek commented Feb 21, 2023

GOT IT. Though I don't know if it's implemented correctly?
The documentation leads me to believe that this should be available in a MuxPane object:
https://wezfurlong.org/wezterm/config/lua/pane/get_pane_direction.html

But I had to get the MuxTab object first:

			local tab = pane:tab()
			wezterm.log_info(tab:get_pane_direction("Left"))

Is this correct/expected?

Also not to continuously praise, but my god those docs are incredible.

wez added a commit that referenced this issue Feb 22, 2023
@wez
Copy link
Owner

wez commented Feb 22, 2023

Ah, yeah, the docs landed in the wrong spot, should get fixed by the next doc push!

@distek
Copy link
Author

distek commented Feb 22, 2023

Awesome! Should I close this then?
I'm going to close this. Reopen if you feel the need :)

@distek distek closed this as completed Feb 22, 2023
@github-actions
Copy link
Contributor

I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues. If you have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Mar 25, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants