Bug in Lterm Project (Fixed)
Lterm is a NJACK Winter of Code project. NWoC is a program that helps students understand the paradigm of Open Source contribution and gives them real world software development experience.
Now, something about the project :- Its a Terminal like copy but for Website, Pretty neat eh ?
At first i checked the project it was pretty cool so i tried more commands, as you can see after you execute every command and press help it shows completed and not completed , probably an array of all the items with a [0,1] value for not completed and completed.
Everything worked great but, When i executed the clear command which didnt show "completed" after i execute it. it was a BUG . i forked the project and went into the codebase :-
- Reading the development section of documentation i knew i had to check the js/main.js
- i knew they would be having an array
arrfor checking if the command is executed or not, initially the value was 0.
- They changed the value to 1 on every execution like this :-
arr[6]=1;
- they had a correct implementation of "clear" command which works with "Clear" aswell.
Then, Why didn't it worked ? i thought about it a bit, then saw that they didnt had implemented the functionality of "clear" command but somehow it worked when i executed, that means there must be some other file which is doing all the ground work. Soon enough i checked the index.html and checked all the linked js files
There was this fileterminal.min.jswhich was interesting, i looked into it and searched "clear:function(){" and got the root of the problem :D
Then, i added thearr[9]=1;but it still didnt worked like i wanted.. hmm what could be the problem this time ?
Maybe the file is not able to access arr ? But it's declaredvar arrIt should be global, i searched on StackOverflow and found an alternative,window.arrcould also make a variable globally accessible. Hmm let's try it in themain.jsfile
And Violla executing theclearorClearcommand works just as it should be.
Here's My PR for the related bug :- PR
Thankyou for reading, If you liked it please press the thumbs up :+1:
Always Keep Sharing, Keep Exploring :)
Have a Nice day and a Happy New Year!!
Posted on Utopian.io - Rewarding Open Source Contributors
Leave Bug in Lterm Project (Fixed) to:
Read more #utopian-io posts
Best Posts From Harshit Luthra
We have not curated any of sachincool's posts yet. But you can encourage our curation team to review posts by visiting them regularly and by referring other readers. Because we give priority to frequently read content.
More Posts From Harshit Luthra
- bjhgddd
- Fixed Critical bug on openfoodfacts Android app
- Add Some Contributing Guidelines for the android app of open food facts
- Added SerialVersionUID to OpenFoodFacts
- Hi
- An eye for an eye
- Categories not visible after landscape mode
- Using Devlight library to make the BottomNav Bar of Phimpme More Attracting
- asda
- Sync Messages From Susi Server
- Merge the fix for firefox
- Utopian posting multiple times for Bug categories
- Susi-Chromebot: Add "Sync Settings While User Logs in & update settings "
- My Proposal to become an Utopian-io Moderator
- Bug in Lterm Project (Fixed)
- Fixed Travis build
- why Did The Bitcoin Market Crashed from 19k to 10k ??? O_o
- Just_Pc_things
- Web Pentesting