Skip to content

Commit

Permalink
~/.zrc modifications
Browse files Browse the repository at this point in the history
  • Loading branch information
Edd12321 committed Apr 22, 2023
1 parent 3e715bc commit f3ba4e9
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 8 deletions.
13 changes: 13 additions & 0 deletions .zrc
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,19 @@ fn extract {
}
}

# Function from Xmodulo
fn kernelgraph {
lsmod | perl -e {
print "digraph \"lsmod\" {";
<>;
while(<>){
@_=split/\s+/;
print "\"$_[0]\" -> \"$_\"\n" for split/,/,$_[3]
}
print "}"
} | dot -Tpng | display -;
}

# Custom tools
# https://github.com/Edd12321/{cstop,evct,zrc}
alias top+ 'cstop;reset'
Expand Down
11 changes: 4 additions & 7 deletions src/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -331,19 +331,16 @@ main(int argc, char *argv[])
std::ifstream fp;
struct passwd *pw;

// make faster I/O
// make faster&unbuffered I/O
std::ios_base::sync_with_stdio(false);

// original file descriptors
o_in = dup(STDIN_FILENO);
o_out = dup(STDOUT_FILENO);

setvbuf(stdout, NULL, _IONBF, 0);

// signal handlers
signal2(SIGCHLD, sigchld_handler);
signal2(SIGINT, sigint_handler);
signal2(SIGTSTP, sigtstp_handler);
signal2(SIGQUIT, sigquit_handler);

// signal ignore
signal2(SIGTTIN, SIG_IGN);
signal2(SIGTTOU, SIG_IGN);
Expand Down
3 changes: 2 additions & 1 deletion src/zlineedit.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -226,7 +226,7 @@ static inline void
clearcin()
{
std::cin.clear();
fflush(stdin);
//fflush(stdin);
}

static inline bool
Expand Down Expand Up @@ -255,6 +255,7 @@ zlineedit(std::string& buf)
dp_list = cursor_pos = 0;
R();
buf.clear();

clearcin();
while (zrawch(c)) {
switch (c) {
Expand Down

0 comments on commit f3ba4e9

Please sign in to comment.