-
-
Notifications
You must be signed in to change notification settings - Fork 492
Adds option to unlock terminal by pressing L thrice #164
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -85,6 +85,7 @@ typedef struct cmatrix { | |
| int console = 0; | ||
| int xwindow = 0; | ||
| int lock = 0; | ||
| int lock_count = 0; | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This can be unsigned, maybe |
||
| cmatrix **matrix = (cmatrix **) NULL; | ||
| int *length = NULL; /* Length of cols in each line */ | ||
| int *spaces = NULL; /* Spaces left to fill */ | ||
|
|
@@ -154,7 +155,7 @@ void usage(void) { | |
| printf(" -c: Use Japanese characters as seen in the original matrix. Requires appropriate fonts\n"); | ||
| printf(" -f: Force the linux $TERM type to be on\n"); | ||
| printf(" -l: Linux mode (uses matrix console font)\n"); | ||
| printf(" -L: Lock mode (can be closed from another terminal)\n"); | ||
| printf(" -L: Lock mode (Press L three times to unlock)\n"); | ||
| printf(" -o: Use old-style scrolling\n"); | ||
| printf(" -h: Print usage and exit\n"); | ||
| printf(" -n: No bold characters (overrides -b and -B, default)\n"); | ||
|
|
@@ -598,7 +599,14 @@ if (console) { | |
| bold = 2; | ||
| break; | ||
| case 'L': | ||
| if (lock == 1) { | ||
| lock_count++; | ||
| } | ||
|
Comment on lines
+602
to
+604
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Maybe add : } else {
lock_count = 0;
lock = 1;
} |
||
| lock = 1; | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Why ? This causes the bug where you press four times L and it breaks. See previous comment. |
||
| if (lock_count == 3) { | ||
| lock = 0; | ||
| lock_count = 0; | ||
| } | ||
| break; | ||
| case 'n': | ||
| bold = 0; | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe change type to
boolfromstdbool.h?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Okay