Re: [code] Unable to run Textadept on Docker container

From: Mitchell <m.att.foicica.com>
Date: Wed, 10 May 2017 09:28:19 -0400 (EDT)

Hi Emil,

On Wed, 10 May 2017, Emil Axelsson wrote:

> Den 2017-05-10 kl. 04:10, skrev Mitchell:
>> Hi Emil,
>>
>> On Tue, 9 May 2017, Emil Axelsson wrote:
>>
>>> [Trying again without +help in the address.]
>>>
>>> Hi!
>>>
>>> I'd like to use Textadept on an Ubuntu Docker container, but it
>>> doesn't work.
>>>
>>> I start with a clean container:
>>>
>>> sudo docker run -it --rm ubuntu
>>>
>>> Inside the container I run the following commands:
>>>
>>> apt-get update
>>> apt-get install -y wget
>>> wget https://foicica.com/textadept/download/textadept_LATEST.x86_64.tgz
>>> tar zxvf textadept_LATEST.x86_64.tgz
>>>
>>> Then when I try to run `textadept_9.4.x86_64/textadept-curses`, I get
>>> a blank terminal. If I press enter I get this message:
>>>
>>> [Message Buffer] - Textadept ([Message Buffer])attempt to index a nil
>>> value
>>> /textadept_9.4.x86_64/themes/term.lua:76: attempt to index a nil value
>>> (field 'run')
>>>
>>> But it's working to some extent: I can move around and type in the
>>> message buffer.
>>>
>>> Any idea what went wrong?
>>
>> Textadept uses `/proc/self/exe` to determine its location and thus the
>> location of its `modules/` directory, which contains the `textadept.run`
>> module among others.
>>
>> I would venture a guess that docker does not supply a similar mechanism,
>> so Textadept has no idea where it is. I did not account for this, so
>> there is no workaround. Sorry :(
>
> Hm.. It seems that `/proc/self/exe` is working fine. Here is what I get from
> inside the container:
>
> # ls -l proc/self/exe
> lrwxrwxrwx 1 root root 0 May 10 07:36 proc/self/exe -> /bin/ls
>
> Any other ideas?

In your ~/.textadept/init.lua add:

   local f = io.open('/tmp/foo', 'w')
   f:write(_HOME)
   f:close()

The contents of /tmp/foo should be the directory of textadept-curses, and
that directory should also contain Textadept's core files and folders
(including "modules/").

Cheers,
Mitchell

-- 
You are subscribed to code.att.foicica.com.
To change subscription settings, send an e-mail to code+help.att.foicica.com.
To unsubscribe, send an e-mail to code+unsubscribe.att.foicica.com.
Received on Wed 10 May 2017 - 09:28:19 EDT

This archive was generated by hypermail 2.2.0 : Thu 11 May 2017 - 06:42:16 EDT