How would you shorten a pendant lamp's electrical cable? It's a USA home from the 1920s.
The question has been asked before, but wrapping an electrical cable around a metal caribeaner seems dangerous.
This installation needs a junction box. Electrical ordinances require that all power connections be made inside an accessible protective box.
In the USA your governing code will be your state's adoption or enhancement of some edition of the NEC. Other places in the civilized world will have similar ordinances. This is why I asked where you are.
If you are handy with detail carpentry, you may be able to do this job yourself, but if you are not confident and comfortable, you should hire a handyman or even an electrician. Ask for someone who can do "old work" "wiring repair".