This version is still in development and is not considered stable yet. For the latest stable version, please use Spring Shell 3.3.3!spring-doc.cn

Introduction

Lets start with a simple app which prints "hello world" in a view.spring-doc.cn

@Autowired
TerminalUIBuilder builder;

void sample() {
	TerminalUI ui = builder.build();
	BoxView view = new BoxView();
	ui.configure(view);
	view.setDrawFunction((screen, rect) -> {
		screen.writerBuilder()
			.build()
			.text("Hello World", rect, HorizontalAlign.CENTER, VerticalAlign.CENTER);
		return rect;
	});
	ui.setRoot(view, true);
	ui.run();
}

There is not much to see here other than TerminalUI is a class handling all logic aroung views and uses View as it’s root view.spring-doc.cn

Section Summary