-
-
Notifications
You must be signed in to change notification settings - Fork 196
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
Tab completion in LLDB command line #286
Comments
Maybe we can bring in PDCursesMod, which has a Win32 API and VT implementation, and doesn't have any dependencies. |
For a no extra dependencies options: wineditline |
winditline is not compatible with libedit's api https://github.com/llvm/llvm-project/blob/7207373e1eb0dd419b4e13a5e2d0ca146ef9544e/lldb/source/Host/common/Editline.cpp#L83-L91 |
ncurses seems pretty heavyweight, so I'm not sure if @mstorsjo would be ok with that. |
I tried to compile the gui interface using the PDCursesMod library via Bill-Gray/PDCursesMod#214 (comment) . The interface looks ok but the diff --git a/lldb/source/Core/IOHandlerCursesGUI.cpp b/lldb/source/Core/IOHandlerCursesGUI.cpp
index 0151255631bf..44d9a78d3923 100644
--- a/lldb/source/Core/IOHandlerCursesGUI.cpp
+++ b/lldb/source/Core/IOHandlerCursesGUI.cpp
@@ -14,6 +14,8 @@
#include <ncurses/curses.h>
#include <ncurses/panel.h>
#else
+#define PDC_WIDE 1
+#define PDC_FORCE_UTF8 1
#include <curses.h>
#include <panel.h>
#endif
@@ -91,8 +93,13 @@ using llvm::StringRef;
#define KEY_ESCAPE 27
#define KEY_DELETE 127
+#ifdef __PDCURSES__
+#define KEY_SHIFT_TAB KEY_BTAB
+#define KEY_ALT_ENTER ALT_ENTER
+#else /* for ncurses */
#define KEY_SHIFT_TAB (KEY_MAX + 1)
#define KEY_ALT_ENTER (KEY_MAX + 2)
+#endif
namespace curses {
class Menu;
@@ -7699,8 +7706,10 @@ void IOHandlerCursesGUI::Activate() {
init_pair(18, COLOR_MAGENTA, COLOR_WHITE);
static_assert(LastColorPairIndex == 18, "Color indexes do not match.");
+#ifndef __PDCURSES__
define_key("\033[Z", KEY_SHIFT_TAB);
define_key("\033\015", KEY_ALT_ENTER);
+#endif
}
}
|
Just as a side note: CMake is using now https://gitlab.kitware.com/cmake/cmake/-/tree/master/Utilities/cmpdcurses for |
windows terminal can config |
Just a heads up: This went from getting tab completion to work (which requires libedit + a curses implementation) to getting LLDB TUI mode to work 😅 But since @SquallATF already got that working, can you also test out libedit? |
It seems LLDB needs libedit for tab completion, which in turn also depends on curses. This is probably hard to integrate on Windows. Had anyone tried? Would it be easier now that Windows have opt-in support for VT sequences?
The text was updated successfully, but these errors were encountered: