Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
- Added terminal font and font size settings (Tools → Options → Claude Code → General); defaults to auto-detection preferring Adwaita Mono for full Unicode coverage of Claude Code TUI symbols (https://github.com/nbclaudecodegui/NetbeansClaudeCodeGui/issues/18)
- Reorganized General and Advanced settings tabs: moved technical settings (hang timeout, MCP port, Enable MCP integration, session list limit, debug mode) to Advanced
- Added a setting to control whether the choice menu grabs keyboard focus (https://github.com/nbclaudecodegui/NetbeansClaudeCodeGui/issues/20)
- Added a global setting to choose the default dock position of the Claude Code session tab (https://github.com/nbclaudecodegui/NetbeansClaudeCodeGui/issues/24)
Expand Down
2 changes: 2 additions & 0 deletions docs/installation.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@

> **Note:** The plugin has been tested with Claude Code CLI 2.1.78 and newer. Older versions may not work correctly.

> **Terminal font (recommended):** The plugin auto-selects the best available monospace font. For full Unicode coverage of Claude Code TUI symbols (spinner ◐, prompt marker ⏵, box-drawing characters), install **Adwaita Mono**. On Linux it is typically pre-installed as part of the GNOME desktop. On macOS and Windows, download it from the [GNOME GitLab release page](https://gitlab.gnome.org/GNOME/adwaita-fonts/-/releases). The active font can be changed in **Tools → Options → Claude Code → General**.

The `claude` executable must be on your system `PATH` **or** its absolute path must be configured in **Tools → Options → Claude Code → General → Claude CLI path** after installing the plugin.

---
Expand Down
Binary file modified docs/screenshots/settings-general.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 2 additions & 2 deletions docs/to-do.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# [ ] Bug 1

Choice menu не распознаёт 4 как вариант для теустового ввода
Choice menu не распознаёт 4 как вариант для текстового ввода

```
╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌
Expand Down Expand Up @@ -34,6 +34,6 @@ Choice menu не распознаёт 4 как вариант для теуст
- С Yes, No - на последний/первый radiobox
- Из текстового поля ввода - на предыдущий/последующий пункт

# [ ] Bug 4
# [x] Bug 4

Не поддерживает skip permition mode в комбо.
12 changes: 12 additions & 0 deletions docs/user-manual.md
Original file line number Diff line number Diff line change
Expand Up @@ -346,6 +346,18 @@ Open **Tools → Options → Claude Code** in NetBeans.
| Show markdown preview for .md files in diff | On | Shows a rendered markdown preview alongside the raw diff for `.md` files. |
| Markdown preview dock position | Right side | Where the Markdown Preview tab is docked when first opened. Choices: Editor area, Right side, Left side top, Left side bottom, Bottom dock. |
| Choice menu focus | Grab focus | Controls whether the choice menu panel grabs keyboard focus when it appears. Choices: Grab focus, Show without grabbing focus, Hide menu. |
| Terminal font | Auto | Font used in the embedded terminal. Click **Choose…** to open the font picker. The label shows the resolved font name (e.g. `Adwaita Mono, 14 (Auto)` when auto-detection is active, or `Monospaced, 14` when set explicitly). |

#### Terminal font picker

The **Choose…** button opens a font picker dialog:

- **Font list** — all installed font families. The first item, **Auto (detect best available)**, lets the plugin choose automatically.
- **Show monospaced only** checkbox — filters the list to monospace fonts (checked by default).
- **Size spinner** — font size, 8–72 pt.
- **Preview** — renders `AaBbCc 0O1Il → ⏵ ◐` in the selected font and size, so you can verify that Claude Code TUI symbols (spinner, prompt marker) are covered.

When **Auto** is selected, the plugin picks the first installed font from this priority list: **Adwaita Mono**, Consolas, Menlo, DejaVu Sans Mono, Monospaced. Adwaita Mono has the broadest Unicode coverage for Claude Code TUI symbols; on Linux GNOME desktops it is usually pre-installed.

### Advanced tab

Expand Down
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

<groupId>io.github.nbclaudecodegui</groupId>
<artifactId>netbeans-claude-code-gui</artifactId>
<version>0.22.25-SNAPSHOT</version>
<version>0.22.27-SNAPSHOT</version>
<packaging>nbm</packaging>
<name>Netbeans Claude Code GUI</name>
<description>NetBeans plugin that provides a GUI for Claude Code CLI — run claude code sessions directly inside the IDE.</description>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
import javax.swing.JTabbedPane;
import javax.swing.JTextField;
import javax.swing.SpinnerNumberModel;
import javax.swing.SwingUtilities;
import javax.swing.table.AbstractTableModel;

/**
Expand Down Expand Up @@ -89,6 +90,14 @@ public final class ClaudeCodeOptionsPanel extends JPanel {
private javax.swing.JLabel fileDiffDockModeLabel;
/** Dropdown for the choice menu focus behavior. */
private javax.swing.JComboBox<String> choiceMenuFocusCombo;
/** Label showing the currently selected terminal font (e.g. "Adwaita Mono, 14"). */
private JLabel terminalFontLabel;
/** Button that opens {@link TerminalFontChooserDialog}. */
private JButton terminalFontButton;
/** Pending terminal font name (not yet saved to preferences); "" = Auto. */
private String pendingFontName = ClaudeCodePreferences.DEFAULT_TERMINAL_FONT_NAME;
/** Pending terminal font size (not yet saved to preferences). */
private int pendingFontSize = ClaudeCodePreferences.DEFAULT_TERMINAL_FONT_SIZE;
/** Spinner for the hang-detection timeout in seconds (0 = disabled). */
private JSpinner hangTimeoutSpinner;
/** Checkbox to enable MCP integration (pass --mcp-config flag). */
Expand Down Expand Up @@ -236,6 +245,24 @@ private JPanel buildGeneralPanel() {
form.add(choiceMenuFocusCombo, gbc(1, row, false));
row++;

// --- terminal font ---
form.add(new JLabel("Terminal font:"), gbc(0, row, false));
terminalFontLabel = new JLabel();
form.add(terminalFontLabel, gbc(1, row, false));
terminalFontButton = new JButton("Choose…");
terminalFontButton.addActionListener(e -> {
TerminalFontChooserDialog dlg = new TerminalFontChooserDialog(
SwingUtilities.getWindowAncestor(this),
pendingFontName,
pendingFontSize);
dlg.setVisible(true);
if (dlg.isConfirmed()) {
updateTerminalFontLabel(dlg.getFontName(), dlg.getFontSize());
}
});
form.add(terminalFontButton, gbc(2, row, false));
row++;

// spacer
GridBagConstraints spacer = new GridBagConstraints();
spacer.gridx = 0; spacer.gridy = row;
Expand Down Expand Up @@ -444,6 +471,9 @@ void load() {
syncExclusion(sendVal, true);
syncExclusion(newlineVal, false);

updateTerminalFontLabel(ClaudeCodePreferences.getTerminalFontName(),
ClaudeCodePreferences.getTerminalFontSize());

profilesPanel.load();
}

Expand Down Expand Up @@ -477,6 +507,8 @@ void store() {
ClaudeCodePreferences.setMcpEnabled(mcpEnabledCheckBox.isSelected());
ClaudeCodePreferences.setSendKey(selectedValue(sendRadios));
ClaudeCodePreferences.setNewlineKey(selectedValue(newlineRadios));
ClaudeCodePreferences.setTerminalFontName(pendingFontName);
ClaudeCodePreferences.setTerminalFontSize(pendingFontSize);

profilesPanel.store();
}
Expand All @@ -494,6 +526,16 @@ boolean valid() {
// helpers
// -------------------------------------------------------------------------

private void updateTerminalFontLabel(String name, int size) {
pendingFontName = name == null ? "" : name;
pendingFontSize = size;
if (pendingFontName.isEmpty()) {
terminalFontLabel.setText(ClaudeCodePreferences.resolveTerminalFontName() + ", " + size + " (Auto)");
} else {
terminalFontLabel.setText(pendingFontName + ", " + size);
}
}

private static void selectRadio(Map<String, JRadioButton> radios,
ButtonGroup group, String value) {
JRadioButton rb = radios.get(value);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package io.github.nbclaudecodegui.settings;

import io.github.nbclaudecodegui.model.SessionMode;
import java.awt.Font;
import java.io.File;
import java.io.IOException;
import java.nio.file.Path;
Expand Down Expand Up @@ -650,6 +651,99 @@ public static void setFileDiffDockMode(DockMode mode) {
: DEFAULT_FILE_DIFF_DOCK_MODE.getModeName());
}

// -------------------------------------------------------------------------
// terminalFontName / terminalFontSize
// -------------------------------------------------------------------------

/** Preference key: terminal font family name. */
public static final String KEY_TERMINAL_FONT_NAME = "terminalFontName";
/**
* Default: empty string — auto-detect the best available font.
* When empty, {@code NetBeansSettingsProvider} walks a priority list
* (Adwaita Mono → Consolas → Menlo → DejaVu Sans Mono → Monospaced)
* and returns the first installed font.
*/
public static final String DEFAULT_TERMINAL_FONT_NAME = "";

/** Preference key: terminal font size in points. */
public static final String KEY_TERMINAL_FONT_SIZE = "terminalFontSize";
/** Default terminal font size (14 pt, matching JediTerm's hardcoded default). */
public static final int DEFAULT_TERMINAL_FONT_SIZE = 14;

/**
* Returns the configured terminal font family name.
*
* @return font name, or {@link #DEFAULT_TERMINAL_FONT_NAME} (empty) for auto-detection
*/
public static String getTerminalFontName() {
return NbPreferences.forModule(ClaudeCodePreferences.class)
.get(KEY_TERMINAL_FONT_NAME, DEFAULT_TERMINAL_FONT_NAME);
}

/**
* Persists the terminal font family name.
*
* @param v font name; {@code null} or blank stores {@link #DEFAULT_TERMINAL_FONT_NAME}
* which triggers auto-detection
*/
public static void setTerminalFontName(String v) {
NbPreferences.forModule(ClaudeCodePreferences.class)
.put(KEY_TERMINAL_FONT_NAME, v == null ? "" : v.trim());
}

/**
* Returns the configured terminal font size in points.
*
* @return font size in the range [8, 72]
*/
public static int getTerminalFontSize() {
return NbPreferences.forModule(ClaudeCodePreferences.class)
.getInt(KEY_TERMINAL_FONT_SIZE, DEFAULT_TERMINAL_FONT_SIZE);
}

/**
* Persists the terminal font size.
*
* @param v font size in points; clamped to [8, 72]
*/
public static void setTerminalFontSize(int v) {
NbPreferences.forModule(ClaudeCodePreferences.class)
.putInt(KEY_TERMINAL_FONT_SIZE, Math.max(8, Math.min(72, v)));
}

/**
* Font candidates tried in order when the terminal font preference is empty (auto-detect).
* The first font whose AWT family does not fall back to {@code "Dialog"} is used.
*/
public static final String[] TERMINAL_FONT_CANDIDATES = {
"Adwaita Mono", // best Unicode coverage for Claude Code TUI symbols
"Consolas", // Windows default
"Menlo", // macOS default
"DejaVu Sans Mono",
"Monospaced" // AWT logical font — always available
};

/**
* Returns the terminal font family name that will actually be used.
* When the user preference is empty (auto-detect), walks {@link #TERMINAL_FONT_CANDIDATES}
* and returns the first installed font name.
*
* @return resolved font family name; never empty
*/
public static String resolveTerminalFontName() {
String name = getTerminalFontName();
if (!name.isEmpty()) {
return name;
}
for (String candidate : TERMINAL_FONT_CANDIDATES) {
Font f = new Font(candidate, Font.PLAIN, 12);
if (!f.getFamily().equals("Dialog")) {
return candidate;
}
}
return "Monospaced";
}

// -------------------------------------------------------------------------
// choiceMenuFocusMode
// -------------------------------------------------------------------------
Expand Down
Loading
Loading