i3term does not run when installed normally #1

Closed
opened 2022-07-20 07:55:27 +00:00 by gmardom · 2 comments
gmardom commented 2022-07-20 07:55:27 +00:00 (Migrated from github.com)

I just saw your video in i3term and tried to install it, but launching it only prints errors.

$ i3term -v
i3term - version: 0
updated: today by budRich

When run after doing make && sudo make install

$ i3term
trap: usage: trap [-lp] [[arg] signal_spec ...]
/usr/bin/i3term: line 181: fg: no job control
/usr/bin/i3term: line 198: : No such file or directory
/usr/bin/i3term: line 204: : No such file or directory
/usr/bin/i3term: line 212: : No such file or directory
/usr/bin/i3term: line 226: : No such file or directory
chmod: cannot access '': No such file or directory
/usr/bin/i3term: line 231: syntax error near unexpected token `}'
/usr/bin/i3term: line 231: `}'

When run after doing make && sudo make install-dev

$ i3term
cp: cannot create regular file '/home/dominik/.config/i3term/config': No such file or directory
/home/dominik/src/i3term/func/parse_config.sh: line 3: /home/dominik/.config/i3term/config: No such file or directory
[ERROR] '' is not a supported terminal. set 'terminal' option in /home/dominik/.config/i3term/config

In both cases config file is not being created. But when I copied config manually to ~/.config/i3term, the dev install worked.

I just saw your video in i3term and tried to install it, but launching it only prints errors. ``` $ i3term -v i3term - version: 0 updated: today by budRich ``` When run after doing `make && sudo make install` ``` $ i3term trap: usage: trap [-lp] [[arg] signal_spec ...] /usr/bin/i3term: line 181: fg: no job control /usr/bin/i3term: line 198: : No such file or directory /usr/bin/i3term: line 204: : No such file or directory /usr/bin/i3term: line 212: : No such file or directory /usr/bin/i3term: line 226: : No such file or directory chmod: cannot access '': No such file or directory /usr/bin/i3term: line 231: syntax error near unexpected token `}' /usr/bin/i3term: line 231: `}' ``` When run after doing `make && sudo make install-dev` ``` $ i3term cp: cannot create regular file '/home/dominik/.config/i3term/config': No such file or directory /home/dominik/src/i3term/func/parse_config.sh: line 3: /home/dominik/.config/i3term/config: No such file or directory [ERROR] '' is not a supported terminal. set 'terminal' option in /home/dominik/.config/i3term/config ``` In both cases config file is not being created. But when I copied config manually to `~/.config/i3term`, the dev install worked.
budRich commented 2022-07-20 21:21:58 +00:00 (Migrated from github.com)

thanks for the report. i will look into it. it seems i have managed to mess up something with my build system, i got reports about installation issues on i3ass as well.

thanks for the report. i will look into it. it seems i have managed to mess up something with my build system, i got reports about installation issues on i3ass as well.
budRich commented 2022-07-22 16:51:55 +00:00 (Migrated from github.com)

Big thanks for this issue @DominikMarcinowski . It exposed two bugs.

I never tried running the normally installed version of the script myself, just checked that all the files got installed and manually reviewed the installed script to see that DATA_DIR was correctly replaced with the expanded $(PREFIX)/$(NAME) (/usr/i3term) and it was. What i didn't catch was that for some reason m4 which did the replacement also removed a singlequote at a completely different location of the script: trap 'CLEANUP' EXIT INT HUP -> trap 'CLEANUP EXIT INT HUP this completely borked the script. This was obvious after running shellcheck on the installed version of the script.

I replaced m4 with sed and now all that is fine.

The other issue was i forgot to create the directory ~/.config/i3term before copying the default config file, so cp failed. I replaced cp with install -D and now everything works.

regarding make install-dev (and make uninstall-dev):
This is what i personally use and as you might have seen they instead symlink the i3term script. I don't use sudo, instead do this: make PREFIX=~ install-dev which will put the symlink at ~/bin/i3term. Reason for this is that now I can edit the functions in func/ and i3term script itself without re-building/re-installing. And this also skipped the whoe m4 replacement thing, and use data/ directory instead of /usr/i3term.

Big thanks for this issue @DominikMarcinowski . It exposed two bugs. I never tried running the normally installed version of the script myself, just checked that all the files got installed and **manually** reviewed the installed script to see that DATA_DIR was correctly replaced with the expanded `$(PREFIX)/$(NAME)` (`/usr/i3term`) and it was. What i didn't catch was that for some reason `m4` which did the replacement also removed a singlequote at a completely different location of the script: `trap 'CLEANUP' EXIT INT HUP` -> `trap 'CLEANUP EXIT INT HUP` this completely borked the script. This was obvious after running `shellcheck` on the installed version of the script. I replaced `m4` with `sed` and now all that is fine. The other issue was i forgot to create the **directory** `~/.config/i3term` before copying the default config file, so cp failed. I replaced `cp` with `install -D` and now everything works. regarding `make install-dev` (and `make uninstall-dev`): This is what i personally use and as you might have seen they instead symlink the [i3term](https://github.com/budlabs/i3term/blob/next/i3term) script. I don't use sudo, instead do this: `make PREFIX=~ install-dev` which will put the symlink at `~/bin/i3term`. Reason for this is that now I can edit the functions in [func/](https://github.com/budlabs/i3term/tree/next/func) and [i3term](https://github.com/budlabs/i3term/blob/next/i3term) script itself without re-building/re-installing. And this also skipped the whoe `m4` replacement thing, and use [data/](https://github.com/budlabs/i3term/tree/next/data) directory instead of `/usr/i3term`.
Sign in to join this conversation.
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
bud/i3term#1
No description provided.