You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: src/docs/troubleshooting.md
+74-7Lines changed: 74 additions & 7 deletions
Original file line number
Diff line number
Diff line change
@@ -9,23 +9,92 @@ menuOrder: 99
9
9
importKeyfrom"$lib/components/key.svelte"
10
10
</script>
11
11
12
+
Sorry to see you here. Terminals can be finicky. Please see below for solutions to common problems.
13
+
14
+
## Contents
15
+
16
+
1.[Key Bindings](#key-bindings)
17
+
1.[Copy-Paste](#copying-and-pasting)
18
+
1.[Colors](#colors)
19
+
1.[Fonts](#fonts)
20
+
12
21
## Key Bindings
13
22
14
-
Harlequin can only react to key presses that are sent to it from the Terminal it is running in. Some common key presses, like <Key>ctrl+enter</Key>, aren't forwarded correctly by some terminals, or may be aliased to a different sort of event.
23
+
Harlequin can only react to key presses that are sent to it from the Terminal it is running in. Some common key presses, like <Key>ctrl+enter</Key>, aren't forwarded correctly by some terminals, or may be aliased to a different key or even a different sort of event.
15
24
16
25
If you don't want to [upgrade your terminal](#terminal-recommendations), you can use the following aliases, which should be supported everywhere (if not, [open an issue](https://github.com/tconbeer/harlequin/issues)):
17
26
18
27
- Run query: use <Key>ctrl+j</Key>, not <Key>ctrl+enter</Key>.
19
-
- Paste text: use <Key>ctrl+u</Key>, not <Key>ctrl+v</Key>.
20
28
- Comment line: use <Key>ctrl+\_</Key> (underscore), not <Key>ctrl+/</Key>.
21
29
- On a Mac: For all bindings, use <Key>^ Control</Key>, not <Key>⌘ Command</Key>.
22
30
31
+
[See here](#copying-and-pasting) for copy and paste.
32
+
33
+
Finally, Harlequin's footer, which lists some of the currently-active key bindings, is clickable. If a binding isn't working, you can click it in the footer to take the same action.
34
+
35
+
### Enabling Key Bindings in VS Code Terminal
36
+
37
+
VS Code intercepts a large number of key presses before they make it to the terminal, even when the terminal is focused. This includes <Key>ctrl+j</Key> (which hides or shows the VS Code terminal!). Fortunately, you can change this behavior in the VS Code settings. If you use a `settings.json` file, you can add this snippet:
Otherwise, you can press <Key>F1</Key> to open the command palette, then type and select "Terminal: Configure Terminal Settings". Then make the following changes:
47
+
48
+
1. Uncheck the option "Terminal > Integrated: Allow Chords"
49
+
2. Check the option "Terminal > Integrated: Send Keybindings to Shell" (you may have to scroll down nearly all the way).
50
+
51
+
## Copying and Pasting
52
+
53
+
<spanclass="text-purple italic font-bold">Note: Currently copying and pasting is only supported by the query editor, not the other widgets.</span>
54
+
55
+
Harlequin's query editor supports cut, copy, and paste. However, this is more complex than it seems. If these features are not working for you, there could be a number of root causes. This section walks through how copy-paste works in Harlequin, and offers some solutions for common problems.
56
+
57
+
### Internal Copy and Paste
58
+
59
+
Harlequin's query editor implements its own internal clipboard, so copying and pasting within the query editor should always work. To test the internal clipboard, select text in the query editor and press <Key>ctrl+c</Key> to copy it. Paste it with <Key>ctrl+u</Key> (`u`, not `v` for this step!). If that doesn't work, Harlequin isn't receiving those key presses from your terminal. Please [open an issue](https://github.com/tconbeer/harlequin/issues).
There are two mechanisms for Harlequin to receive clipboard data when you initiate a paste.
64
+
65
+
1. Harlequin receives a key press that it interprets as a paste command. This happens when you press <Key>ctrl+u</Key>, and depending on your terminal, may or may not happen when you press <Key>ctrl+v</Key>. When Harlequin interprets a key press as a paste command, it attempts to access the system clipboard and paste its contents. If it cannot access the system clipboard, Harlequin will paste the contents of its internal clipboard. To determine if Harlequin can access the system clipboard:
66
+
67
+
- Copy some text outside of Harlequin.
68
+
- Focus on the Harlequin query editor, then press <Key>ctrl+u</Key> (`u`, not `v` for this step!).
69
+
- If Harlequin does not paste anything, or if it pastes something different from what you just copied, Harlequin cannot access the system clipboard. You can work around this by pasting using your terminal's built-in paste functionality, or by fixing its access to the system clipboard (keep reading).
70
+
71
+
2. Harlequin receives a native `Paste` message from the terminal. To trigger a `Paste` message, you want to use the same keys that you would to paste into your shell. This might be <Key>ctrl+v</Key>, <Key>shift+insert</Key>, or a right click of your mouse. When Harlequin receives a `Paste` message, it will insert the contents of that message into the query editor. Since this doesn't rely on the clipboard, this should work on nearly any terminal, whether Harlequin and the terminal share a host or not. Many terminals allow you to configure the key or mouse bindings for `Paste`.
72
+
73
+
If Harlequin cannot access the system clipboard, there may be a couple of causes:
74
+
75
+
1. If Harlequin is installed on Linux, you may be missing a clipboard library. Try `sudo apt get xclip` or `sudo apt get xsel` to install a library that will allow Harlequin to access the system clipboard.
76
+
2. Harlequin's host (the operating system where Harlequin is running) may have its clipboard disabled. This is common in GitHub Codespaces, CI runners, and other servers that don't typically support user input or a display. If you control the server, you can install or start an X Server (like X11) to enable the clipboard. As a workaround, try triggering a native `Paste` event in your terminal instead.
77
+
3. If your terminal is attaching to a remote host to run Harlequin, e.g., via SSH, the terminal or SSH client may or may not support clipboard "redirection" (sharing the clipboard between the machines). In this case, Harlequin may be able to access its host's clipboard, but that clipboard won't be the same as the one you use for everything else. As a workaround, try triggering a native `Paste` event in your terminal instead (sadly this might also be disabled).
78
+
79
+
If all is lost, you can open a text file with Harlequin with <Key>ctrl+o</Key> or by clicking "Open Query" in the footer.
If you've made it this far, I'm so sorry. I hope you've learned something today.
84
+
85
+
The same dynamics from above apply, but we don't have the `Paste` event to move the data for us. The workarounds are:
86
+
87
+
1. You can try to use your terminal's native copy functionality. This is unlikely to do what you want, since it'll copy Harlequin's UI (borders, whitespace, etc), alongside your query. But if you want to try:
88
+
89
+
- In your terminal's settings, enable "Copy on Selection." You can test this in your shell -- if you select (highlight) text with your mouse, it should get copied to your clipboard.
90
+
- In Harlequin, hold <Key>Shift</Key> while using your mouse to select the text you want to copy (on most terminals, this triggers selection when the terminal is in "app mode"). You'll know you're doing this right if the highlight color is different from what you normally see when highlighting text in Harlequin. Your selection should get copied to the clipboard (whitespace, `|`'s, and all).
91
+
92
+
2. You can save your query to a file and open it in another program. Press <Key>ctrl+s</Key> or click "Save Query" in the footer.
93
+
23
94
## Appearance
24
95
25
96
Harlequin should look great in your terminal. If it doesn't, it may be because we depend on your terminal and shell for rendering, and those may require some configuration on your machine.
26
97
27
-
<spanid="colors"></span>
28
-
29
98
### Colors
30
99
31
100
Modern terminal emulators can display millions of colors, in a scheme called "truecolor." Older terminals could only display 256 colors, or even as few as 8.
@@ -59,14 +128,12 @@ To use a different font with Harlequin, download and install the font, and then
59
128
60
129
<spanclass="text-purple italic font-bold">Note for Mac Terminal.app Users:</span>
61
130
62
-
Only some fonts render right with the default Terminal app. [See here](https://textual.textualize.io/FAQ/#why-doesnt-textual-look-good-on-macos) for a workaround.
131
+
Only some fonts render right with the default Terminal app. You may need to adjust your line spacing. [See here](https://textual.textualize.io/FAQ/#why-doesnt-textual-look-good-on-macos) for instructions.
63
132
64
133
<spanclass="text-purple italic font-bold">Note for WSL2 and Windows Terminal users:</span>
65
134
66
135
Windows Terminal runs in Windows and attaches your Linux shell over the WSL network. You need to install your font in **Windows** for this to work.
67
136
68
-
<spanid="terminal-recommendations"></span>
69
-
70
137
## Terminal Recommendations
71
138
72
139
If you are using the default Mac Terminal or Windows Command Prompt, you may want to switch to a more modern terminal. The following terminals are free and come highly recommended:
0 commit comments