Jump to content




[1.79] Shell is bricked/borked if you navigate to a certain directory


3 replies to this topic

#1 Boom

  • Members
  • 39 posts

Posted 28 April 2017 - 05:32 AM

VERSION: 1.79

DESCRIPTION:
The ComputerCraft built-in shell will break if you navigate to /rom/help (CC helpfiles directory)

EXPECTED RESULT:
You cannot execute any commands, but you can forcefully restart or shutdown your computer via the CTRL+S/CTRL+R key combo.

REPRODUCTION STEPS:
  • Type cd /rom/help to visit the CC helpfiles directory
  • Try to execute any command (cd, ls, help, shutdown, restart, etc.)
SCREENSHOT/VIDEO:
Spoiler

THIS IS NOT A BUG. PLEASE SEE SQUIDDEV'S EXPLANATION BELOW.

Mods, please lock this thread kthx


Edited by Boom, 29 April 2017 - 03:29 AM.


#2 SquidDev

    Frickin' laser beams | Resident Necromancer

  • Members
  • 1,427 posts
  • LocationDoes anyone put something serious here?

Posted 28 April 2017 - 06:24 AM

This isn't a bug, just a effect of how the shell works. When you run a program like "ls", it will look for the file in each element of the path. On a normal computer, the path is roughly ".", "/rom/programs", "/rom/programs/rednet", etc...

This means when you are in the "/rom/help" directory and run "list", it looks in the /rom/help directory first, finds the documentation file, and tries to execute that. However, the contents of "/rom/programs/list" is
ls will list all the directories and files in the current location. Use "type" to find out if an item is a file or a directory.
This obviously isn't a valid Lua file, and so errors. If you need to get out, just give the absolute path to the "cd" program: "/rom/programs/cd ../".

TLDR: Not a bug, just caused by weird shell mechanics.

See also

Edited by SquidDev, 28 April 2017 - 06:30 AM.


#3 Lupus590

  • Members
  • 2,029 posts
  • LocationUK

Posted 28 April 2017 - 10:08 AM

either way, I would suggest that Dan200 should probably make the shell use the path and then local files (perhaps with local files being forced with ./fileName )

#4 CLNinja

  • Members
  • 191 posts

Posted 28 April 2017 - 09:32 PM

View PostLupus590, on 28 April 2017 - 10:08 AM, said:

either way, I would suggest that Dan200 should probably make the shell use the path and then local files (perhaps with local files being forced with ./fileName )
Thats how my friend and I designed our OS Vorbani. It will always point to our sbin or bin folders first (path in this case) and then you need to force local files if you even want to run them.





1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users