ProzillaOS/docs/features/applications/terminal
2023-07-23 20:35:52 +02:00
..
README.md Updated docs with examples 2023-07-23 20:35:52 +02:00

← Back

Terminal

A command line tool.

Commands

See src/features/applications/terminal/commands.js for a list of commands. You can edit this file to add/remove/edit commands.

Examples

// src/features/applications/terminal/commands.js

new Command("cd", (args, { currentDirectory, setCurrentDirectory }) => {
	const path = args[0] ?? "~"; // Default to home directory
	const destination = currentDirectory.navigate(path);

	if (!destination)
		return `cd: ${args[0]}: No such file or directory`;

	setCurrentDirectory(destination);
	return { blank: true }; // Returns without printing anything to the terminal
}),