We have moved to a new Sailfish OS Forum. Please start new discussions there.
47

Make Fingerterm/Bash startup execute standard profile/bashrc scripts [answered]

asked 2013-12-29 11:34:59 +0300

dtw gravatar image

updated 2014-07-16 10:42:16 +0300

Fingerterm startup currently doesn't seem to execute ~/.bash_profile or ~/.bashrc files. I think it would be nice improvement if the standard shell startup (bash) worked like it does in Unix/Linux systems.

Edit: Fixed in 1.0.8.19.

edit retag flag offensive reopen delete

The question has been closed for the following reason "the question is answered, an answer was accepted" by dtw
close date 2014-07-16 10:43:10.433409

Comments

For some reason when fingerterm is launched through /usr/bin/invoker (that's what happens when you launch it from fingerterm's icon), /etc/bashrc, /etc/profile.d/* and /home/${USER}/.bashrc are not sourced.. This doesn't happen if you launch explicitly fingerterm from command line, over SSH.

Milo ( 2013-12-29 13:31:04 +0300 )edit

I would change this to "Make Fingerterm use standard bash". If I try to run "rpm -q bash -i" I get "package -i is not installed". The same command in ssh or even in fingerterm launched from ssh works fine.

etam ( 2013-12-30 00:02:47 +0300 )edit
1

I've got some more info about FingerTerm:

  1. It starts sh not bash.
  2. It should read config from .config/FingerTerm/settings.ini, but every time I change something, it overwrites it with default one.
etam ( 2013-12-30 01:07:34 +0300 )edit

And obey /etc/password which for users nemo and root (for devel-su) has set shell to /bin/bash.

mcfrisk ( 2014-04-17 12:08:18 +0300 )edit

4 Answers

Sort by » oldest newest most voted
3

answered 2014-01-04 13:31:52 +0300

hlub gravatar image

updated 2014-01-04 13:33:41 +0300

I hesitate a bit to submit this as an answer, because I didn't manage to coax bash into reading its rcfiles when started from fingerterm

But I think zsh is close enough to bash to be comfortble for bash users (I may be biased, as i use zsh as my login shell), and, importantly, zsh does honour its rcfiles when run from fingerterm

So: as root do

 # pkcon install zsh
 # chsh -s /bin/zsh nemo

If you want to fine-tune a few things (starting in home directory, dropping unnecessary privileges) you might want to use a wrapper script for fingerterm.

edit flag offensive delete publish link more

Comments

zsh is not installable by default

$ pkcon install zsh
Command failed: This tool could not find any available package: could not find zsh
paulvt ( 2014-03-28 19:06:49 +0300 )edit

To install zsh, enable Mer-Tools repository as per step 5 in the instructions on:
http://talk.maemo.org/showthread.php?t=92036

Copy/paste from that page:
5) additional softwares in mer-tools repository, e.g. : dosfstools, emacs, git, htop, less, mtools, parted, powertop, rsync, ruby 1.9.3, strace, sudo, tcl/tk 8.5.12, zsh.
First enable the repository by entering root (with Developer Mode password) :
$ devel-su
ssu ar mer-tools
ssu ur
$ pkcon refresh

And then:
pkcon install zsh

oitos ( 2014-05-18 04:14:56 +0300 )edit
3

answered 2014-01-06 10:46:58 +0300

icebox gravatar image

As a temporary fix as I didn't want to mess with changing the fingerterm shortcut to a local ssh I added a menu entry by editing /home/nemo/.config/FingerTerm/menu.xml to read:

<item>
    <title>init</title>
    <command>cd /home/nemo\r . .bashrc\r</command>
</item>
edit flag offensive delete publish link more

Comments

1

Saner alternative:

cd ~ &amp;&amp; . .bashrc\r

BTW: Code markup does not work in Together comments if its on the first line of the question/comment.

marsch ( 2014-01-27 15:58:07 +0300 )edit
15

answered 2014-01-08 21:32:32 +0300

Turski gravatar image

updated 2014-06-02 18:47:12 +0300

This is happening, because all applications are launched with invoker, and invoker sets POSIXLY_CORRECT environment variable, which causes bash to start in posix mode. Temporary fix would be editing the fingerterm.desktop file's exec line as follows:

/usr/share/applications/fingerterm.desktop:
-------------------------------------------
[Desktop Entry]
Type=Application
Name=Terminal
#Exec=fingerterm
Exec=sh -c "cd ~; unset POSIXLY_CORRECT; exec fingerterm"
Icon=icon-l-terminal

For some reason bash doesn't invoke correctly with just "env -u POSIXLY_CORRECT fingerterm", I don't know why. Invoker should however at least clean that environment variable after it isn't anymore needed in option parsing. Posix mode probably explains also other troubles with commands in fingerterm.

EDIT: This will be fixed in update 8. Issue #22

edit flag offensive delete publish link more

Comments

Yay! It works :) The exec line can be shortened to sh -c "cd; unset POSIXLY_CORRECT; fingerterm"

etam ( 2014-01-09 00:41:13 +0300 )edit
1

It's better to have "exec fingerterm", since with exec, the fingerterm process replaces the sh process. If it is left out, the unnescessary shell will be left running to background.

Turski ( 2014-01-09 01:01:09 +0300 )edit

The launcher disappeared when I did that (I had a typo on my first attempt, maybe that's why).

killall lipstick

sent me sailing again without a reboot.

patrikf ( 2014-01-13 19:19:45 +0300 )edit

works for me. I was wondering why I can mount davfs over ssh but not with fingerprint.

pipapo ( 2014-06-01 23:00:53 +0300 )edit
0

answered 2014-07-16 02:52:32 +0300

Milo gravatar image

Seems like this was fixed with the latest release: 1.0.8.19.

edit flag offensive delete publish link more

Comments

Indeed. It's fixed.

dtw ( 2014-07-16 10:41:25 +0300 )edit

Question tools

Follow
8 followers

Stats

Asked: 2013-12-29 11:34:59 +0300

Seen: 3,047 times

Last updated: Jul 16 '14