Skip to content

Commit 037c7de

Browse files
added partial macOS support and updated README, .gitignore
1 parent 64ae10c commit 037c7de

File tree

4 files changed

+111
-3
lines changed

4 files changed

+111
-3
lines changed

README

Lines changed: 59 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
=================================
21
BiCon - The Bidirectional Console
32
=================================
43

@@ -13,7 +12,11 @@ Installation
1312

1413
You need the FriBidi library to compile this program. Probably
1514
you have it in your distribution. If not, get it from
16-
http://fribidi.org/
15+
http://fribidi.org/ . You can install it via Homebrew as well (works on both Linux and macOS):
16+
17+
``` sh
18+
brew install fribidi
19+
```
1720

1821
Installation is simple, the usual steps:
1922

@@ -22,6 +25,17 @@ Installation is simple, the usual steps:
2225
make
2326
make install
2427

28+
29+
macOS
30+
-----
31+
32+
Things seem to somewhat work, but:
33+
- The build fails its last step because there is no `psfaddtable` on macOS. This doesn't seem to matter.
34+
- The built binary can be found at `./bicon/bicon.bin`.
35+
- Sometimes programs exit abnormally: `[1] 15104 abort bicon.bin ls`. This also doesn't seem to matter, but you do need to do a `reset` on the terminal after it.
36+
- I have added a test file that triggers this: `bicon.bin cat ./macOS/test.txt`
37+
- Opening a shell with `bicon` seems to work without problems.
38+
2539
Usage
2640
-----
2741

@@ -43,6 +57,49 @@ You can use the alt+shift combination to switch keyboard language.
4357

4458
Of course, you have a man page bicon(1) to check.
4559

60+
Emacs
61+
-----
62+
63+
This works for me:
64+
65+
``` zsh
66+
function bicon-emc() {
67+
bicon.bin --reshape-only emacsclient -t "$@"
68+
reset
69+
}
70+
```
71+
72+
Known Issues
73+
------------
74+
75+
* [Some](https://github.com/behdad/bicon/issues/24) zsh plugins are somewhat incompatible with running under `bicon`:
76+
* zsh-syntax-highlighting
77+
* zdharma/fast-syntax-highlighting
78+
* zsh-users/zsh-autosuggestions
79+
80+
One workaround is to wrap your invocations of `bicon` in:
81+
82+
``` sh
83+
biconm () {
84+
BICON_MODE=y bicon.bin "$@"
85+
}
86+
bicon-zsh () {
87+
biconm zsh
88+
reset
89+
}
90+
```
91+
92+
Then check if `zsh` is running under `bicon`:
93+
94+
``` sh
95+
isBicon () {
96+
test -n "$BICON_MODE"
97+
}
98+
if ! isBicon ; then
99+
antibody bundle zdharma/fast-syntax-highlighting # etc
100+
fi
101+
```
102+
46103
Reporting Bugs
47104
--------------
48105

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
README

bicon/pty_spawn.c

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,13 @@ namely the PSF License Agreement For Python 2.2.3
1313
#include <string.h>
1414
#include <unistd.h>
1515
#include <errno.h>
16-
#include <pty.h>
16+
#ifdef __APPLE__
17+
#include <util.h>
18+
#pragma GCC diagnostic ignored "-Wimplicit-function-declaration"
19+
#pragma GCC diagnostic ignored "-Wreturn-type"
20+
#else
21+
#include <pty.h>
22+
#endif
1723
#include <sys/time.h>
1824
#include <sys/types.h>
1925
#include <sys/select.h>

macOS/test.txt

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
مهندسی انرژی.html
2+
مهندسی صنایع.html
3+
مهندسی عمران.html
4+
مهندسی انرژی.json
5+
مهندسی صنایع.json
6+
مهندسی عمران.json
7+
مهندسی مکانیک (پردیس کیش).html
8+
مهندسی هوافضا (پردیس کیش).html
9+
مهندسی مکانیک (پردیس کیش).json
10+
مهندسی هوافضا (پردیس کیش).json
11+
مهندسی مکانیک (پردیس تهران).html
12+
مهندسی مکانیک (پردیس تهران).json
13+
مهندسی فناوری اطلاعات (پردیس تهران).html
14+
مهندسی فناوری اطلاعات (پردیس تهران).json
15+
مهندسی مکانیک.html
16+
مهندسی هوافضا.html
17+
مهندسی مکانیک.json
18+
مهندسی هوافضا.json
19+
مهندسی کامپیوتر (پردیس کیش).html
20+
مهندسی کامپیوتر (پردیس کیش).json
21+
مهندسی کامپیوتر(پردیس تهران).html
22+
مهندسی کامپیوتر(پردیس تهران).json
23+
مهندسی کامپیوتر.html
24+
مهندسی کامپیوتر.json
25+
مهندسی مکاترونیک (پردیس تهران).html
26+
مهندسی مکاترونیک (پردیس تهران).json
27+
مهندسی سیستم?های انرژی.html
28+
مهندسی سیستم?های انرژی.json
29+
مهندسی نانوفناوری (پردیس کیش).html
30+
مهندسی نانوفناوری (پردیس کیش).json
31+
گرافیک(مرکز آموزش مهارتهای مهندسی).html
32+
گرافیک(مرکز آموزش مهارتهای مهندسی).json
33+
زبان?ها و زبان?شناسی (پردیس کیش).html
34+
زبان?ها و زبان?شناسی (پردیس کیش).json
35+
بیوشیمی.html
36+
بیوشیمی.json
37+
پژوهشکده علوم و فن?آوری نانو.html
38+
پژوهشکده علوم و فن?آوری نانو.json
39+
پژوهشکده الکترونيک.html
40+
پژوهشکده الکترونيک.json
41+
پژوهشکده سیاست?گذاری علم، فناوری و صنعت.html
42+
پژوهشکده سیاست?گذاری علم، فناوری و صنعت.json
43+
کارگاه?ها(مرکز آموزش مهارتهای مهندسی).html
44+
کارگاه?ها(مرکز آموزش مهارتهای مهندسی).json

0 commit comments

Comments
 (0)