-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.cpp
More file actions
50 lines (40 loc) · 1.13 KB
/
Copy pathmain.cpp
File metadata and controls
50 lines (40 loc) · 1.13 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
#include <cstdlib>
#include <clocale>
#include <iostream>
#include <ncpp/NotCurses.hh>
#include <ncpp/Plane.hh>
#include <string>
#include "options.h"
#include "theme.h"
#include <shell.h>
int main() {
if (setlocale(LC_ALL, "") == nullptr) {
return EXIT_FAILURE;
}
struct notcurses_options nc_opts = default_notcurses_options();
ncpp::NotCurses nc(nc_opts);
if(!nc){
std::cout<<"not abel to get not curser";
return EXIT_FAILURE;
}
unsigned DimY,DimX;
nc.get_term_dim(&DimY, &DimX);
if (!nc) return EXIT_FAILURE;
ncpp::Plane* p_std_plane = nc.get_stdplane();
p_std_plane->set_scrolling(true);
Theme theme;
ncpp::Cell base(' ');
base.set_bg_rgb8(theme.TERM_CRUST_BG.r(),
theme.TERM_CRUST_BG.g(),
theme.TERM_CRUST_BG.b());
p_std_plane->set_base_cell(base);
// p_std_plane->erase();
if (!p_std_plane) {
nc.stop();
std::cerr << "Failed to get std_plane \n";
return EXIT_FAILURE;
}
Shell sh(p_std_plane,nc,DimY,DimX);
int shell_result = sh.run_shell();
return shell_result;
}