Hi all, on my Win 10 laptop I have tried various touchpad gestures and key combinations but the best I can get is a zoom on the whole page, not just the text within the editor.
The actual instance of Node-red is running on another machine on my LAN, I access it via I.P address with a browser (Opera, but tried also Firefox).
I have read that settings.js can be edited to change font size but I can't find such a file.
Any ideas ?
You can change the Monaco editor options from settings.js
codeEditor: {
options: {
/** The follow options only apply if the editor is set to "monaco"
*
* theme - must match the file name of a theme in
* packages/node_modules/@node-red/editor-client/src/vendor/monaco/dist/theme
* e.g. "tomorrow-night", "upstream-sunburst", "github", "my-theme"
*/
theme: 'vs-dark', // 'vs',
/** other overrides can be set e.g. fontSize, fontFamily, fontLigatures etc. */
fontSize: 14,
// fontFamily: "Cascadia Code, Fira Code, Consolas, 'Courier New', monospace",
fontFamily: 'Consolas, "Courier New", monospace',
fontLigatures: false,
colorDecorators: true,
dragAndDrop: true,
linkedEditing: true,
minimap: { enabled: false },
mouseWheelZoom: true,
showFoldingControls: 'always',
useTabStops: true,
tabSize: 4,
bracketPairColorization: { enabled: true },
},
},
Look at the node red startup log and it will tell you where it is. Usually it is in the same folder as the flows file.
Not sure how to do that. I ssh'ed into the other machine which is headless, and searched for settings.js but nothing appears.
Are you running Node-RED via Dave's shell script install or via Docker?
As Colin already pointed out, the node-red log tells you where the file is when node-red starts. How you installed Node-RED determines how to view the logs.
Outside of the logs ...
If using Dave's script, you likely have it running under its own user id. Check the /home/ folder for a node-red user folder. Then in that, you should have a .node-red/ folder and the settings.js file is in there.
If desperate, something like this shell command should find it:
find /home -name "settings.js"
If using Docker, you should have set up a folder that is mounted to docker as /data, it will be in there.
If you stop and start Node-RED from the command-line (with $node-red-stop and $node-red-start), you should see the start-up log that shows where the settings.js file is located.
Welcome to Node-RED
===================
19 May 15:46:35 - [info] Node-RED version: v5.0.0-beta.4
19 May 15:46:35 - [info] Node.js version: v20.19.1
19 May 15:46:35 - [info] Linux 6.1.21-v8+ arm LE
19 May 15:46:36 - [info] Loading palette nodes
19 May 15:46:38 - [info] node-red-contrib-telegrambot version: v17.4.0
19 May 15:46:39 - [info] Dashboard version 3.6.6 started at /ui
19 May 15:46:40 - [info] Settings file : /home/pi/.node-red/settings.js
19 May 15:46:40 - [info] Context store : 'default' [module=memory]
19 May 15:46:40 - [info] User directory : /home/pi/.node-red
19 May 15:46:40 - [info] Projects directory: /home/pi/.node-red/projects
19 May 15:46:40 - [info] Server now running at http://127.0.0.1:1880/
Note: Node-RED is in a hidden directory e.g. /home/pi/.node-red as shown by the . (dot)
To "see" hidden directories or hidden files you need to use $ls -a from the command-line.
Edit : Added tail -1 to restrict the output to just the most recent restart
The OP has not actually said what machine Node-red runs on, but s/he says it is headless, which, at least to me, implies it's Linux.
Assuming you have a normal Node-red installation on Linux, this command might be useful:
journalctl -u nodered | grep "Settings file" | tail -1
For me, this returns
May 10 20:44:08 orangepi Node-RED[520]: 10 May 20:44:04 - [info] Settings file : /home/pi/.node-red/settings.js
It shows that settings.js is in the conventional directory, $HOME/.node-red
If this command gives an error, or nothing, perhaps you have an unusual installation.
The editor indeed runs in the browser, on Windows 10, but settings.js lives on the Node-red machine.
Just re-read @usernamepasswordBS posting again and seen the statement...
The actual instance of Node-red is running on another machine on my LAN,
I have a feeling from the clues in the other thread, @usernamepasswordBS has the ace editor and/or an old version of node-red.
@usernamepasswordBS please post a screenshot of the code editor in a function node.
This is using the less capable/ outdated ACE editor. To get the most from node-red you should update to latest version (if possible) and switch to Monaco editor.
In the settings file you would set the code editor lib to "monaco" (on newer versions V3+ of node-red you simply remove the setting and it defaults to Monaco editor)
// Existing settings
// ...
editorTheme: {
codeEditor: {
lib: "monaco", //can be "monaco" or "ace"
options: {
// /* theme - must match the file name of a theme in
// * packages/node_modules/@node-red/editor-client/src/vendor/monaco/dist/theme
// * e.g. "tomorrow-night", "upstream-sunburst", "github", "my-theme"
// */
theme: "github",
fontSize: 14,
fontLigatures: true,
fontFamily: "Cascadia Code, Fira Code, Consolas, 'Courier New', monospace",
fontWeight: "300",
colorDecorators: true,
showFoldingControls: 'always',
"bracketPairColorization.enabled": true
},
// Other settings
// ..
I'm not sure if I can update Node-red without an update of the Venus OS and I'm not mad-keen on changing anything about that as it works flawlessly at the moment (I've gone and said it now !)
It says it's V3.1.10.
I can't remember when Monaco was implemented. Steve seems to be suggesting that v3+ should be OK. So you still need to edit the settings.js file as already indicated.
I will have another hunt for the settings file and add Steve's lines.
Thanks all.
